zsh-workers
 help / color / mirror / code / Atom feed
4b7d98ba0606d4cda60573a312b9d88afc6e9f53 blob 738 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
27
28
29
30
31
32
 
#compdef stdbuf gstdbuf

local -a short long buf args
local i opt gnu=0

short=( -e -i -o )
long=( --error --input --output )
buf=( err in out )

opt='[set initial buffering for std${buf[i]}]: : _alternative
  "sizes\: \: _numbers -u bytes size k M G"
  "modes\:mode\:((0\:unbuffered L\:line\ buffered'
if _pick_variant gnu=GNU freebsd --version; then
  gnu=1
  args=(
    '(- *)--help[display usage information]'
    '(- *)--version[display version information]'
  )
else
  opt+=' B\:fully\ buffered'
fi
opt+='))"'

for ((i=1;i<=3;i++)); do
  args+=( "(${long[i]})${short[i]}+${(e)opt}" )
  (( gnu )) && args+=(
    "(${short[i]})${long[i]}=${(e)opt}"
  )
done
(( CURRENT > 2 )) && args+=( '*::command:_normal' )

_arguments -s -S $args
debug log:

solving 4b7d98ba0 ...
found 4b7d98ba0 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).