diff options
Diffstat (limited to 'completions/cfrun')
-rw-r--r-- | completions/cfrun | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/completions/cfrun b/completions/cfrun index 72b6138..445bccd 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -1,9 +1,9 @@ # cfrun completion -*- shell-script -*- -_cfrun() +_comp_cmd_cfrun() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return local i section=1 for ((i = 1; i < cword; i++)); do @@ -16,13 +16,13 @@ _cfrun() 1) case $prev in -f) - _filedir + _comp_compgen_filedir return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '-f -h -d -S -T -v' -- "$cur")) + _comp_compgen -- -W '-f -h -d -S -T -v' else local hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts for ((i = 1; i < cword; i++)); do @@ -33,15 +33,15 @@ _cfrun() done [[ ! -f $hostfile ]] && return - COMPREPLY=($(compgen -W "$(command grep -v \ - -E '(=|^$|^#)' $hostfile)" -- "$cur")) + _comp_compgen_split -- "$(command grep -v -E '(=|^$|^#)' \ + "$hostfile")" fi ;; 2) - COMPREPLY=($(compgen -W '$(_parse_help cfagent)' -- "$cur")) + _comp_compgen_help -c cfagent --help ;; esac } && - complete -F _cfrun cfrun + complete -F _comp_cmd_cfrun cfrun # ex: filetype=sh |