zsh-workers
 help / color / mirror / code / Atom feed
49a03ba2c68397e6d179509310294425b223cbb3 blob 793 bytes (raw)

 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
 
#compdef wc gwc

local args

args=(
  '(-c --bytes)'{-c,--bytes}'[print byte counts]'
  '(-C -m --chars)'{-m,--chars}'[print character counts]'
  '(-w --words)'{-w,--words}'[print word counts]'
  '(-l --lines)'{-l,--lines}'[print line counts]'
)

if _pick_variant gnu=GNU unix --version; then
  args+=(
    '(*)--files0-from=[read NUL-terminated file list from specified file]:file:_files'
    '(-L --max-line-length)'{-L,--max-line-length}'[print longest line lengths]'
  )
else
  args=( -A "-*" "${(@)args:#(|\(*\))(|\*)--*}" )
  case $OSTYPE in
    freebsd*|netbsd*) args+=( '-L[print longest line lengths]' ) ;;
    openbsd*) args+=( '-h[human readable: use unit suffixes]' ) ;;
    solaris*) args+=( ${${(M)args:#*-m\[*}//-m\[/-C\[} ) ;;
  esac
fi

_arguments -s -S $args '*:file:_files'
debug log:

solving 49a03ba2c ...
found 49a03ba2c in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).