diff options
Diffstat (limited to 'completions/ulimit')
-rw-r--r-- | completions/ulimit | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/completions/ulimit b/completions/ulimit index 3887cdf5..e596bf72 100644 --- a/completions/ulimit +++ b/completions/ulimit @@ -10,33 +10,33 @@ _ulimit() local mode case $prev in -a) - COMPREPLY=( $(compgen -W "-S -H" -- "$cur") ) + COMPREPLY=($(compgen -W "-S -H" -- "$cur")) return ;; - -[SH]) - ;; + -[SH]) ;; + -*) mode=$prev ;; esac - if [[ -z "$mode" ]]; then + if [[ ! -v mode ]]; then local word for word in "${words[@]}"; do [[ $word == -*a* ]] && return done - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_usage "$1")' -- "$cur")) return fi fi local args _count_args - [[ $args -eq 1 ]] && \ - COMPREPLY=( $(compgen -W "soft hard unlimited" -- "$cur") ) + ((args == 1)) && + COMPREPLY=($(compgen -W "soft hard unlimited" -- "$cur")) } && -complete -F _ulimit ulimit + complete -F _ulimit ulimit # ex: filetype=sh |