about summary refs log tree commit diff
path: root/Completion/Unix/Command/_w
blob: 69751c5e59975e5ffd519442c59b2fe45187ee1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#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 -n --no-truncat)'{-n,--no-truncat}'[non-truncated listing (large)]'
      + 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