diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/gnokii | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-upstream/2.11.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/gnokii')
-rw-r--r-- | completions/gnokii | 134 |
1 files changed, 68 insertions, 66 deletions
diff --git a/completions/gnokii b/completions/gnokii index ff43c3d1..039141ae 100644 --- a/completions/gnokii +++ b/completions/gnokii @@ -3,7 +3,7 @@ _gnokii_memory_type() { # TODO: reduce the number of choices - COMPREPLY=( $(compgen -W "IN OU SM ME MT" -- "$cur") ) + COMPREPLY=($(compgen -W "IN OU SM ME MT" -- "$cur")) } _gnokii() @@ -20,123 +20,123 @@ _gnokii() local config_file for config_file in "$XDG_CONFIG_HOME/gnokii/config" \ "$HOME/.config/gnokii/config" "$HOME/.gnokiirc" \ - "$XDG_CONFIG_DIRS/gnokii/config" /etc/gnokiirc ; do + "$XDG_CONFIG_DIRS/gnokii/config" /etc/gnokiirc; do [[ -f $config_file ]] && break done [[ ! -f $config_file ]] && return - COMPREPLY=( $(compgen -W \ + COMPREPLY=($(compgen -W \ "$(command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file)" \ - -- "$cur") ) + -- "$cur")) return ;; --help) - COMPREPLY=( $(compgen -W 'all monitor sms mms phonebook calendar + COMPREPLY=($(compgen -W 'all monitor sms mms phonebook calendar todo dial profile settings wap logo ringtone security file - other' -- "$cur") ) + other' -- "$cur")) return ;; - --version|--shell|ping) + --version | --shell | ping) return ;; # MONITOR --monitor) - COMPREPLY=( $(compgen -W 'delay once' -- "$cur") ) + COMPREPLY=($(compgen -W 'delay once' -- "$cur")) return ;; - --getdisplaystatus|--displayoutput) + --getdisplaystatus | --displayoutput) return ;; --netmonitor) - COMPREPLY=( $(compgen -W 'reset off field devel next nr' \ - -- "$cur") ) + COMPREPLY=($(compgen -W 'reset off field devel next nr' \ + -- "$cur")) return ;; # SMS --sendsms) - # (how)TODO ? + # (how)TODO ? return ;; --savesms) - COMPREPLY=( $(compgen -W '--sender --smsc --smscno --folder - --location --sent --read --deliver --datetime' -- "$cur") ) + COMPREPLY=($(compgen -W '--sender --smsc --smscno --folder + --location --sent --read --deliver --datetime' -- "$cur")) return ;; - --memory-type|--memory|--getsms|--deletesms|--getmms|--deletemms|\ - --getphonebook|--deletephonebook) + --memory-type | --memory | --getsms | --deletesms | --getmms | --deletemms | \ + --getphonebook | --deletephonebook) _gnokii_memory_type return ;; - --getsmsc|--getcalendarnote|--deletecalendarnote|--gettodo|\ - --getspeeddial) + --getsmsc | --getcalendarnote | --deletecalendarnote | --gettodo | \ + --getspeeddial) # TODO: grab a specific entry ID return ;; - --setsmsc|--smsreader|--createsmsfolder|--deletealltodos|\ - --showsmsfolderstatus) + --setsmsc | --smsreader | --createsmsfolder | --deletealltodos | \ + --showsmsfolderstatus) return ;; - --deletesmsfolder|--folder) + --deletesmsfolder | --folder) # TODO: folderid return ;; --writephonebook) - COMPREPLY=( $(compgen -W '--overwrite --find-free --memory-type - --location --vcard --ldif' -- "$cur") ) + COMPREPLY=($(compgen -W '--overwrite --find-free --memory-type + --location --vcard --ldif' -- "$cur")) return ;; - --writecalendarnote|--writetodo) + --writecalendarnote | --writetodo) _filedir vcf return ;; # DIAL - --setspeeddial|--dialvoice|--senddtmf|--answercall|--hangup) + --setspeeddial | --dialvoice | --senddtmf | --answercall | --hangup) # TODO return ;; --divert) - COMPREPLY=( $(compgen -W '--op' -- "$cur") ) + COMPREPLY=($(compgen -W '--op' -- "$cur")) return ;; # PROFILE - --getprofile|--setactiveprofile) + --getprofile | --setactiveprofile) # TODO return ;; - --setprofile|--getactiveprofile) + --setprofile | --getactiveprofile) return ;; # SETTINGS --reset) - COMPREPLY=( $(compgen -W 'soft hard' -- "$cur") ) + COMPREPLY=($(compgen -W 'soft hard' -- "$cur")) return ;; - --setdatetime|--setalarm) + --setdatetime | --setalarm) # TODO return ;; - --getdatetime|--getalarm) + --getdatetime | --getalarm) return ;; # WAP - --getwapbookmark|--writewapbookmark|--deletewapbookmark|\ - --getwapsetting|--writewapsetting|--activatewapsetting) + --getwapbookmark | --writewapbookmark | --deletewapbookmark | \ + --getwapsetting | --writewapsetting | --activatewapsetting) return ;; # LOGOS --sendlogo) - COMPREPLY=( $(compgen -W 'caller op picture' -- "$cur") ) + COMPREPLY=($(compgen -W 'caller op picture' -- "$cur")) return ;; - --setlogo|--getlogo) - COMPREPLY=( $(compgen -W 'op startup caller dealer text' \ - -- "$cur") ) + --setlogo | --getlogo) + COMPREPLY=($(compgen -W 'op startup caller dealer text' \ + -- "$cur")) return ;; --viewlogo) @@ -145,77 +145,79 @@ _gnokii() ;; --entersecuritycode) - COMPREPLY=( $(compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur") ) + COMPREPLY=($(compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur")) return ;; - # TODO: RINGTONES + # TODO: RINGTONES esac # second level completion - if [[ $((cword-2)) -ge 1 && ${words[cword-2]} =~ --* ]]; then - pprev=${words[cword-2]} + if [[ $((cword - 2)) -ge 1 && ${words[cword - 2]} =~ --* ]]; then + pprev=${words[cword - 2]} case $pprev in --setspeeddial) _gnokii_memory_type return ;; - --getsms|--deletesms|--getmms|--deletemms|--getphonebook|\ - --writetodo|--writecalendarnote) + --getsms | --deletesms | --getmms | --deletemms | --getphonebook | \ + --writetodo | --writecalendarnote) # TODO: start number return ;; - --gettodo|--getcalendarnote) - COMPREPLY=( $(compgen -W '{1..9} end --vCal' -- "$cur") ) + --gettodo | --getcalendarnote) + COMPREPLY=($(compgen -W '{1..9} end --vCal' -- "$cur")) return ;; --deletecalendarnote) - COMPREPLY=( $(compgen -W '{1..9} end' -- "$cur") ) + COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) return ;; --divert) - COMPREPLY=( $(compgen -W 'register enable query disable - erasure' -- "$cur") ) + COMPREPLY=($(compgen -W 'register enable query disable + erasure' -- "$cur")) return ;; esac fi # third level completion - if [[ $((cword-3)) -ge 1 && ${words[cword-3]} =~ --* ]]; then - tprev=${words[cword-3]} + if [[ $((cword - 3)) -ge 1 && ${words[cword - 3]} =~ --* ]]; then + tprev=${words[cword - 3]} case $tprev in - --deletesms|--deletemms) - COMPREPLY=( $(compgen -W 'end' -- "$cur") ) + --deletesms | --deletemms) + COMPREPLY=($(compgen -W 'end' -- "$cur")) return ;; - --getphonebook|--writetodo|--writecalendarnote) - COMPREPLY=( $(compgen -W '{1..9} end' -- "$cur") ) + --getphonebook | --writetodo | --writecalendarnote) + COMPREPLY=($(compgen -W '{1..9} end' -- "$cur")) return ;; - --gettodo|--getcalendarnote) - [[ ${words[cword-1]} == end ]] && \ - COMPREPLY=( $(compgen -W '--vCal' -- "$cur") ) + --gettodo | --getcalendarnote) + [[ ${words[cword - 1]} == end ]] && + COMPREPLY=($(compgen -W '--vCal' -- "$cur")) return ;; --divert) - COMPREPLY=( $(compgen -W '--type' -- "$cur") ) + COMPREPLY=($(compgen -W '--type' -- "$cur")) return + ;; esac fi # fourth level completion - if [[ $((cword-4)) -ge 1 && ${words[cword-4]} =~ --* ]]; then - fprev=${words[cword-4]} + if [[ $((cword - 4)) -ge 1 && ${words[cword - 4]} =~ --* ]]; then + fprev=${words[cword - 4]} case $fprev in --getphonebook) - COMPREPLY=( $(compgen -W '--raw --vcard --ldif' -- "$cur") ) + COMPREPLY=($(compgen -W '--raw --vcard --ldif' -- "$cur")) return ;; --divert) - COMPREPLY=( $(compgen -W 'all busy noans outofreach notavail' \ - -- "$cur") ) + COMPREPLY=($(compgen -W 'all busy noans outofreach notavail' \ + -- "$cur")) return + ;; esac fi @@ -226,10 +228,10 @@ _gnokii() # don't provide main command completions if one is # already on the command line - [[ $COMP_LINE =~ $(tr ' ' '\b|'<<<$main_cmd) ]] && return + [[ $COMP_LINE =~ $(tr ' ' '\b|' <<<$main_cmd) ]] && return - COMPREPLY=( $(compgen -W "$all_cmd" -- "$cur") ) + COMPREPLY=($(compgen -W "$all_cmd" -- "$cur")) } && -complete -F _gnokii gnokii + complete -F _gnokii gnokii # ex: filetype=sh |