Skip to content

Commit

Permalink
Remove short options from completions.
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-palmer committed Sep 17, 2021
1 parent 9904abe commit 67a751f
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ _cgiexecute_completion() {
COMPREPLY=()

if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-h --host -t --timeout -u --username -p --password -c --certificate -H --help" -- "$2"))
elif [[ $3 == -c || $3 = --certificate ]]; then
COMPREPLY=($(compgen -W "--host --timeout --username --password --certificate --help" -- "$2"))
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
else
# Because the completion word list contains ':' characters which affect how readline
Expand Down Expand Up @@ -43,11 +43,11 @@ complete -F _cgiexecute_completion cgiexecute

_mediastream_completion() {
if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-f --file -t --timeout -m --multicast -p --port -v --volume -C --codec \
-u --username -p --password -c --certificate -H --help" -- "$2"))
elif [[ $3 == -c || $3 = --codec ]]; then
COMPREPLY=($(compgen -W "--file --timeout --multicast --port --volume --codec \
--username --password --certificate --help" -- "$2"))
elif [[ $3 = --codec ]]; then
COMPREPLY=($(compgen -W "g711 g722" -- "$2"))
else
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
fi

Expand All @@ -58,8 +58,8 @@ complete -F _mediastream_completion mediastream

_screenshot_completion() {
if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-h --host -t --timeout -u --username -p --password -c --certificate -H --help" -- "$2"))
else
COMPREPLY=($(compgen -W "--host --timeout --username --password --certificate --help" -- "$2"))
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
fi

Expand All @@ -70,8 +70,8 @@ complete -F _screenshot_completion screenshot

_setbackground_completion() {
if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-h --host -t --timeout -u --username -p --password -c --certificate -H --help" -- "$2"))
else
COMPREPLY=($(compgen -W "--host --timeout --username --password --certificate --help" -- "$2"))
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
fi

Expand All @@ -82,8 +82,8 @@ complete -F _setringtone_completion setbackground

_setringtone_completion() {
if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-h --host -t --timeout -u --username -p --password -c --certificate -H --help" -- "$2"))
else
COMPREPLY=($(compgen -W "--host --timeout --username --password --certificate --help" -- "$2"))
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
fi

Expand All @@ -94,8 +94,8 @@ complete -F _setringtone_completion setringtone

_xmlinfo_completion() {
if [[ ${2:0:1} = - ]]; then
COMPREPLY=($(compgen -W "-h --host -t --timeout -u --username -p --password -c --certificate -H --help" -- "$2"))
elif [[ $3 == -c || $3 = --certificate ]]; then
COMPREPLY=($(compgen -W "--host --timeout --username --password --certificate --help" -- "$2"))
elif [[ $3 = --certificate ]]; then
COMPREPLY=($(compgen -f -- "$2"))
else
COMPREPLY=($(compgen -W "line call settings mode" -- "$2"))
Expand All @@ -105,4 +105,3 @@ _xmlinfo_completion() {
}

complete -F _xmlinfo_completion xmlinfo

0 comments on commit 67a751f

Please sign in to comment.