diff options
Diffstat (limited to 'completions/oggdec')
-rw-r--r-- | completions/oggdec | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/completions/oggdec b/completions/oggdec index 97bde20..a76ba49 100644 --- a/completions/oggdec +++ b/completions/oggdec @@ -1,38 +1,40 @@ # bash completion for oggdec(1) -*- shell-script -*- -_oggdec() +_comp_cmd_oggdec() { - local cur prev words cword split - _init_completion -s || return + local cur prev words cword was_split comp_args + _comp_initialize -s -- "$@" || return + local noargopts='!(-*|*[beso]*)' + # shellcheck disable=SC2254 case $prev in - --help | --version | -!(-*)[hV]*) + --help | --version | -${noargopts}[hV]*) return ;; - --bits | -!(-*)b) - COMPREPLY=($(compgen -W "8 16" -- "$cur")) + --bits | -${noargopts}b) + _comp_compgen -- -W "8 16" return ;; - --endianness | --sign | -!(-*)[es]) - COMPREPLY=($(compgen -W "0 1" -- "$cur")) + --endianness | --sign | -${noargopts}[es]) + _comp_compgen -- -W "0 1" return ;; - --output | -!(-*)o) - _filedir wav + --output | -${noargopts}o) + _comp_compgen_filedir wav return ;; esac - $split && return + [[ $was_split ]] && return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) + _comp_compgen_help [[ ${COMPREPLY-} == *= ]] && compopt -o nospace return fi - _filedir ogg + _comp_compgen_filedir ogg } && - complete -F _oggdec oggdec + complete -F _comp_cmd_oggdec oggdec # ex: filetype=sh |