34 lines
1.5 KiB
Bash
34 lines
1.5 KiB
Bash
# Source this file in bash before using it:
|
|
# source <(./voipms-cli.php completion bash)
|
|
#
|
|
# To make it persistent for this project, add that line to your shell profile
|
|
# or write this output to a file loaded by bash-completion.
|
|
|
|
_voipms_cli()
|
|
{
|
|
local cur prev commands
|
|
COMPREPLY=()
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
commands="cdr completion e911Info e911Validate getBalance getCDR getCallAccounts getCallBilling getCallRecording getCallRecordings getCallTypes getDIDsInfo getFaxMessagePDF getFaxMessages getForwardings getIP getLNPList getLNPStatus getMMS getPhonebook getRates getRegistrationStatus getSMS getServersInfo getSubAccounts getTerminationRates getTransactionHistory getVoicemailSetups help list sendCallRecordingEmail sendFaxMessage sendMMS sendSMS setDIDInfo setDIDRouting setForwarding setPhonebook setSubAccount"
|
|
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
|
COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") )
|
|
return 0
|
|
fi
|
|
|
|
case "${prev}" in
|
|
--format)
|
|
COMPREPLY=( $(compgen -W "pretty json raw" -- "${cur}") )
|
|
return 0
|
|
;;
|
|
--username|--password|--endpoint|--param)
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
if [[ "${cur}" == --* ]]; then
|
|
COMPREPLY=( $(compgen -W "--username --password --endpoint --format --param --dry-run" -- "${cur}") )
|
|
return 0
|
|
fi
|
|
}
|
|
complete -o default -F _voipms_cli voipms-cli.php ./voipms-cli.php |