diff options
author | Eric Cook <illua@users.sourceforge.net> | 2016-06-14 21:26:58 -0400 |
---|---|---|
committer | Eric Cook <illua@users.sourceforge.net> | 2016-06-14 21:26:58 -0400 |
commit | bc1acf5b0e277ac3e5d7d57b9194b06931e5e406 (patch) | |
tree | 131f554802e1084b72835e6ed0a367b9658e584c /Completion/Linux/Command/_pidof | |
parent | 2162c1a2d2d86de4c2b956fb924c4d5acbbd0de9 (diff) | |
download | zsh-bc1acf5b0e277ac3e5d7d57b9194b06931e5e406.tar.gz zsh-bc1acf5b0e277ac3e5d7d57b9194b06931e5e406.tar.xz zsh-bc1acf5b0e277ac3e5d7d57b9194b06931e5e406.zip |
38676, 38680: Completion for pidof and localedef.
Diffstat (limited to 'Completion/Linux/Command/_pidof')
-rw-r--r-- | Completion/Linux/Command/_pidof | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Completion/Linux/Command/_pidof b/Completion/Linux/Command/_pidof new file mode 100644 index 000000000..6605e7e67 --- /dev/null +++ b/Completion/Linux/Command/_pidof @@ -0,0 +1,24 @@ +#compdef pidof + +local curcontext="$curcontext" state line expl ret=1 +typeset -A opt_args + +local exargs="-h --help -V --version" +_arguments -C -s -w \ + '(- *)'{-h,--help}'[display help information]' \ + '(- *)'{-V,--version}'[print program version]' \ + "(-s --single-shot $exargs)"{-s,--single-shot}'[return one PID only]' \ + "(-c --check-root $exargs)"{-c,--check-root}'[omit processes with different root]' \ + "(-x $exargs)"-x'[include shells running named scripts]' \ + "($exargs)"\*{-o+,--omit-pid}'[omit processes with PIDs]:pids:_sequence -s , _pids' \ + '*:process:->procnames' \ + && return 0 + +case $state in + procnames) + # Handle defunct processes and "avahi-daemon:" + _wanted process-names expl process compadd ${${${${${(@)${(f)"$(ps -N --ppid 2 -p 2 o args=)"}%% *}##*/}%:}#\[}%]} && ret=0 + ;; +esac + +return ret |