diff options
author | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-08 18:29:15 +0000 |
---|---|---|
committer | Paul Ackersviller <packersv@users.sourceforge.net> | 2007-04-08 18:29:15 +0000 |
commit | b014b04d3a4858af0b9e21769181a881fd0c1ae5 (patch) | |
tree | 2e55635da9ec9130cf2de6275f1ad87b3becc611 | |
parent | 926b98cad2c0b75f17058934de84cb0b952f45a5 (diff) | |
download | zsh-b014b04d3a4858af0b9e21769181a881fd0c1ae5.tar.gz zsh-b014b04d3a4858af0b9e21769181a881fd0c1ae5.tar.xz zsh-b014b04d3a4858af0b9e21769181a881fd0c1ae5.zip |
Merge from trunk of workers/{20946,20953,21380}.
-rw-r--r-- | Completion/Linux/Command/_iwconfig | 68 | ||||
-rw-r--r-- | Completion/Unix/Command/_du | 44 |
2 files changed, 112 insertions, 0 deletions
diff --git a/Completion/Linux/Command/_iwconfig b/Completion/Linux/Command/_iwconfig new file mode 100644 index 000000000..8ec8dfef2 --- /dev/null +++ b/Completion/Linux/Command/_iwconfig @@ -0,0 +1,68 @@ +#compdef iwconfig + +local curcontext="$curcontext" state line expl ret=1 + +_arguments -C \ + '(1 * -)--help[display help information]' \ + '(1 * -)--version[display version information]' \ + '1:network interface:_net_interfaces' \ + '*:parameter:->parameters' && ret=0 + +if [[ -n "$state" ]]; then + local -a arg + + case $words[CURRENT-1] in + essid) _wanted -x names expl 'network name' compadd off any on ;; + nwid|domain) _message -e ids 'network id' ;; + freq|channel) _message -e channels 'channel or frequency' ;; + sens) _message -e levels 'signal level' ;; + mode) + _wanted modes expl 'operating mode' compadd \ + Ad-Hoc Managed Master Repeater Secondary Monitor Auto + ;; + ap) _message -e access-points 'access point' ;; + nick*) _message -e names 'nickname' ;; + rate|bit*) _message -e bit-rates 'bit rate' ;; + rts*|frag*) _message -e sizes 'size' ;; + key|enc*) _message -e keys 'key' ;; + power) + arg=( + \*{min,max}'[modifier]' + '*off[disable power management]' + '*on[enable power management]' + '*all[receive all packets]' + 'unicast[receive unicast packets only]' + 'multicast[receive multicast and broadcast packets only]' + ) + ;& + min|max) + _values -S ' ' -w 'parameter' \ + 'period[set the period between wake ups]' \ + 'timeout[set timeout before sleep]' \ + $arg[@] && ret=0 + ;; + period|timeout) _message -e timeouts 'timeout' ;; + txpower) _message -e power 'transmit power' ;; + retry) _message -e retries 'retries' ;; + *) + _values -S ' ' -w 'option' \ + 'essid[set the network name]' \ + '(nwid domain)'{nwid,domain}'[set the network ID]' \ + '(freq channel)'{freq,channel}'[set the operating frequency or channel]' \ + 'sens[set the sensitivity threhold]' \ + 'mode[set operating mode]' \ + 'ap[register with given access point]' \ + '(nick nickname)'nick{,name}'[set the nickname]' \ + '(rate bit)'{rate,bit}'[set the bitrate]' \ + 'rts[set packet size threshold for sending RTS]' \ + 'frag[set maximum packet fragment size]' \ + \*{key,enc}'[add encryption key]' \ + '*power[manipulate power management scheme parameters]' \ + 'txpower[set transmit power]' \ + 'retry[set number of retries]' \ + 'commit[apply changes imediately]' && ret=0 + ;; + esac +fi + +return ret diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du new file mode 100644 index 000000000..0486cac7c --- /dev/null +++ b/Completion/Unix/Command/_du @@ -0,0 +1,44 @@ +#compdef du + +if _pick_variant gnu=Free\ Soft unix --version /dummy/no-such-file; then + _arguments -s \ + '(-a --all -s --summarize)'{-a,--all}'[write counts for all files]' \ + '--apparent-size[print apparent sizes rather than disc usage]' \ + '(-B --block-size -k)'{-B,--block-size=}'[specify block size]:size (bytes)' \ + '(-B --block-size -k --apparent-size -b --bytes)'{-b,--bytes}'[equivalent to --apparent-size --block-size=1]' \ + '(-c --total)'{-c,--total}'[produce a grand total]' \ + '(-D --dereference-args -L --dereference)'{-D,--dereference-args}'[dereference arguments that are symlinks]' \ + '(-h --human-readable -H --si)'{-h,--human-readable}'[print sizes in human readable format]' \ + '(-H --si -h --human-readable)'{-H,--si}'[human readable form using powers of 1000]' \ + '(-B --block-size)-k[use block size of 1k]' \ + '(-l --count-links)'{-l,--count-links}'[count sizes many times if hard linked]' \ + '(-L --dereference -D --dereference-args)'{-L,--dereference}'[dereference all symlinks]' \ + '(-S --separate-dirs)'{-S,--seperate-dirs}'[do not include size of subdirectories]' \ + '(-s --summarize --max-depth -a --all)'{-s,--summarize}'[only display total for each argument]' \ + '(-x --one-file-system)'{-x,--one-file-system}'[skip directories on different filesystems]' \ + \*{-X+,--exclude-from=}'[exclude files matching any pattern in file]:file:_files' \ + '*--exclude=[exclude files matching pattern]:pattern' \ + '(-s --summarize)--max-depth=[maximum levels to recurse]:levels' \ + '(* -)--help[display help information]' \ + '(* -)--version[display version information]' \ + '*:file:_files' + return +else + # based on $OSTYPE = solaris2.8 + local xdev='[skip directories on different filesystems]' + if [[ ${commands[$words[1]]:-$words[1]} = *xpg4* ]]; then + args=( -x$xdev ) + else + args=( -d$xdev + '-L[dereference symlinks]' + "(-a)-o[do not add child directories' usage to parent's total]" + ) + fi + _arguments -s "$args[@]" \ + '(-s -o)-a[write counts for all files]' \ + '-k[use block size of 1k]' \ + '-r[notify about unreadable files/directories]' \ + '(-a)-s[only display total for each argument]' \ + '*:file:_files' + return +fi |