#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# qbt bash wrapper to prompt user when trying to save password
if [[ "$@" == "settings set password" ]]; then
  echo "Setting password is not supported"
  echo "Please use --ask-for-password or --password"
elif [[ "$@" == "settings set"* ]]; then
  /qbt/qbt "$@"
elif [[ "$@" != *"--ask-for-password"* ]] && [[ "$@" != *"--password"* ]];then
  echo "Please use --ask-for-password or --password and ensure username/url are set"
  /qbt/qbt "$@"
else
  /qbt/qbt "$@"
fi
