about summary refs log tree commit diff
path: root/Completion/Unix/Command/_w
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-08-25 15:08:30 +0200
committerOliver Kiddle <opk@zsh.org>2017-08-25 15:08:30 +0200
commit86f9edbc9d32dd6ad4637c6618499692f32c3b18 (patch)
tree38245271caa751fbf287466b1ad80ca0a604143e /Completion/Unix/Command/_w
parent97d4bdbc7e86e6e8da0d4a059b118ffab289d3a9 (diff)
downloadzsh-86f9edbc9d32dd6ad4637c6618499692f32c3b18.tar.gz
zsh-86f9edbc9d32dd6ad4637c6618499692f32c3b18.tar.xz
zsh-86f9edbc9d32dd6ad4637c6618499692f32c3b18.zip
41598: new who and w completions
Diffstat (limited to 'Completion/Unix/Command/_w')
-rw-r--r--Completion/Unix/Command/_w47
1 files changed, 47 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_w b/Completion/Unix/Command/_w
new file mode 100644
index 000000000..8fb4154c7
--- /dev/null
+++ b/Completion/Unix/Command/_w
@@ -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