diff options
Diffstat (limited to 'completions/lsof')
-rw-r--r-- | completions/lsof | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/completions/lsof b/completions/lsof index eb1e967..07559b3 100644 --- a/completions/lsof +++ b/completions/lsof @@ -1,56 +1,56 @@ # lsof(8) completion -*- shell-script -*- -_lsof() +_comp_cmd_lsof() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return case $prev in -'?' | -h | +c | -c | -d | -F | -i | +r | -r | -s | -S | -T) return ;; -A | -k | -m | +m | -o) - _filedir + _comp_compgen_filedir return ;; +d | +D) - _filedir -d + _comp_compgen_filedir -d return ;; -D) - COMPREPLY=($(compgen -W '? b i r u' -- "$cur")) + _comp_compgen -- -W '? b i r u' return ;; -f) - COMPREPLY=($(compgen -W 'c f g G n' -- "$cur")) + _comp_compgen -- -W 'c f g G n' return ;; -g) # TODO: handle ^foo exclusions, comma separated lists - _pgids + _comp_compgen_pgids return ;; -p) # TODO: handle ^foo exclusions, comma separated lists - _pids + _comp_compgen_pids return ;; -u) # TODO: handle ^foo exclusions, comma separated lists - COMPREPLY=($(compgen -u -- "$cur")) + _comp_compgen -- -u return ;; esac if [[ $cur == [-+]* ]]; then - COMPREPLY=($(compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g - -i -k -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t - -u -U -v -V +w -w -x -X -z -Z' -- "$cur")) + _comp_compgen -- -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g -i -k + -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t -u -U + -v -V +w -w -x -X -z -Z' return fi - _filedir + _comp_compgen_filedir } && - complete -F _lsof lsof + complete -F _comp_cmd_lsof lsof # ex: filetype=sh |