diff options
Diffstat (limited to 'completions/rpcdebug')
-rw-r--r-- | completions/rpcdebug | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/completions/rpcdebug b/completions/rpcdebug index ce4f9372..6e2b88c5 100644 --- a/completions/rpcdebug +++ b/completions/rpcdebug @@ -2,18 +2,18 @@ _rpcdebug_flags() { - local i module - for (( i=0; i < ${#words[@]}; i++ )); do + for ((i = 1; i < ${#words[@]}; i++)); do if [[ ${words[i]} == -m ]]; then - module=${words[i+1]} + module=${words[i + 1]} + break fi done if [[ -n $module ]]; then - COMPREPLY=( $(compgen -W "$(rpcdebug -vh 2>&1 | \ - command sed -ne 's/^'$module'[[:space:]]\{1,\}//p')" -- "$cur") ) + COMPREPLY=($(compgen -W "$(rpcdebug -vh 2>&1 | + command sed -ne 's/^'$module'[[:space:]]\{1,\}//p')" -- "$cur")) fi } @@ -32,15 +32,15 @@ _rpcdebug() return ;; -*m) - COMPREPLY=( $(compgen -W 'rpc nfs nfsd nlm' -- "$cur") ) + COMPREPLY=($(compgen -W 'rpc nfs nfsd nlm' -- "$cur")) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1" -h) -s -c' -- "$cur") ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1" -h) -s -c' -- "$cur")) fi } && -complete -F _rpcdebug rpcdebug + complete -F _rpcdebug rpcdebug # ex: filetype=sh |