mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
41598: new who and w completions
This commit is contained in:
parent
97d4bdbc7e
commit
86f9edbc9d
3 changed files with 116 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2017-08-25 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 41598: Completion/Unix/Command/_w,
|
||||
Completion/Unix/Command/_who: new who and w completions
|
||||
|
||||
2017-08-24 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 41590 (modified as per 41595): README, Doc/Zsh/options.yo,
|
||||
|
|
47
Completion/Unix/Command/_w
Normal file
47
Completion/Unix/Command/_w
Normal file
|
@ -0,0 +1,47 @@
|
|||
#compdef w
|
||||
|
||||
local args
|
||||
|
||||
case $OSTYPE in
|
||||
linux*)
|
||||
args=(
|
||||
'(H -f --from)'{-f,--from}'[toggle display of remote hostname]'
|
||||
'(H -h)--no-header[suppress the heading]'
|
||||
'(H -i --ip-addr)'{-i,--ip-addr}'[display IP address instead of hostname]'
|
||||
'(H -o --old-style -s --short)'{-o,--old-style}'[old style output format]'
|
||||
'(H -s --short -o --old-style)'{-s,--short}'[use short output format]'
|
||||
'(H -u --no-current)'{-u,--no-current}'[ignore the username while figuring out the current process and cpu times]'
|
||||
+ H
|
||||
'(-)--help[display help information]'
|
||||
'(-)'{-V,--version}'[display version information]'
|
||||
)
|
||||
;;
|
||||
*bsd*|darwin*|dragonfly*)
|
||||
args+=( '-i[sort output by idle time]' )
|
||||
;|
|
||||
openbsd*)
|
||||
args+=( '-a[translate network addresses into names]' )
|
||||
;|
|
||||
(free|net)bsd*|dragonfly*)
|
||||
args+=( '-n[show network addresses as numbers]' )
|
||||
;|
|
||||
*bsd*|dragonfly*)
|
||||
args+=(
|
||||
'-M+[extract values from specified core]:core file:_files'
|
||||
'-N+[extract name list from specified system]:system file:_files'
|
||||
)
|
||||
;|
|
||||
freebsd*|dragonfly*)
|
||||
args+=( '-d[dump process list on a per controlling tty basis]' )
|
||||
;|
|
||||
solaris*)
|
||||
args+=( '!(-s -w -l)'{-l,-w}
|
||||
'-s[short output form]'
|
||||
'(-)-u[produce only the heading line]'
|
||||
)
|
||||
;|
|
||||
esac
|
||||
|
||||
_arguments -S -s \
|
||||
'(--no-header)-h[suppress the heading]' \
|
||||
'*:user:_users' $args
|
64
Completion/Unix/Command/_who
Normal file
64
Completion/Unix/Command/_who
Normal file
|
@ -0,0 +1,64 @@
|
|||
#compdef who gwho
|
||||
|
||||
local args variant
|
||||
|
||||
_pick_variant -r variant gnu=GNU $OSTYPE --version
|
||||
|
||||
case $variant in
|
||||
gnu)
|
||||
args=(
|
||||
'(Q -a --all -b --boot -d --dead -l --login -p --process -q --count -r --runlevel -t --time -T -w --mesg --message --writable -u --users)'{-a,--all}'[same as -b -d --login -p -r -t -T -u]'
|
||||
'(Q -b --boot)'{-b,--boot}'[print time of last system boot]'
|
||||
'(Q -d --dead -a --all)'{-d,--dead}'[print dead processes]'
|
||||
'(Q -H --heading)'{-H,--heading}'[print line of column headings]'
|
||||
'(Q -l --login)'{-l,--login}'[print system login processes]'
|
||||
'(Q)--lookup[canonicalize hostnames via DNS]'
|
||||
'(Q)-m[print information about current terminal]'
|
||||
'(Q -p --process)'{-p,--process}'[print active processes spawned by init]'
|
||||
'(Q -r --runlevel)'{-r,--runlevel}'[print current runlevel]'
|
||||
'(Q -t --time)'{-t,--time}'[print last system clock change]'
|
||||
'(Q -T -w --mesg --message --writable)'{-T,-w,--mesg,--message,--writable}"[show user's message acceptance status as +, - or ?]"
|
||||
'(Q -u --users)'{-u,--users}'[show idle time]'
|
||||
'!(Q -a)-s' '!(Q -a)--short'
|
||||
+ Q
|
||||
'(-)'{-q,--count}'[print only login names and number of users logged on]'
|
||||
'(-)--help[display help information]'
|
||||
'(-)--version[display version information]'
|
||||
)
|
||||
;;
|
||||
darwin*|dragonfly*|netbsd*|solaris*)
|
||||
args=(
|
||||
'(Q -a)-d[print dead processes]'
|
||||
'(Q -a)-l[print system login processes]'
|
||||
'(Q -a)-p[print active processes spawned by init]'
|
||||
'(Q -a)-r[print current runlevel]'
|
||||
'(Q -a)-t[print last system clock change]'
|
||||
)
|
||||
;|
|
||||
dragonfly*|netbsd*)
|
||||
args+=( '(Q)-v[show process exit status, session id etc]' )
|
||||
;|
|
||||
(net|free)bsd*|darwin*|dragonfly*|solaris*)
|
||||
args+=(
|
||||
'(Q -b -d -p -r -T -u)-a[print all entries]'
|
||||
'(Q -a)-b[print time of last system boot]'
|
||||
'!(Q -a)-s'
|
||||
)
|
||||
;|
|
||||
*)
|
||||
args+=(
|
||||
'(Q)-H[print line of column headings]'
|
||||
'(Q)-m[print information about current terminal]'
|
||||
"(Q -a)-T[show user's message acceptance status as +, - or ?]"
|
||||
'(Q -a)-u[show idle time]'
|
||||
+ Q '(-a -b -d -H -l -m -p -r -s -t -T -v)-q[print only login names and number of users logged on]'
|
||||
)
|
||||
;|
|
||||
solaris*)
|
||||
args+=(
|
||||
'(-a -b -d -H -l -m -p -r -s -t -T)-n+[specify number of users to list per line]:number'
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
_arguments -s -S ':file:_files' $args
|
Loading…
Reference in a new issue