diff options
Diffstat (limited to 'Completion/BSD/Command')
-rw-r--r-- | Completion/BSD/Command/_cksum | 67 | ||||
-rw-r--r-- | Completion/BSD/Command/_cu | 59 | ||||
-rw-r--r-- | Completion/BSD/Command/_ldap | 87 | ||||
-rw-r--r-- | Completion/BSD/Command/_powerd | 2 | ||||
-rw-r--r-- | Completion/BSD/Command/_systat | 1 | ||||
-rw-r--r-- | Completion/BSD/Command/_watch-snoop | 2 |
6 files changed, 141 insertions, 77 deletions
diff --git a/Completion/BSD/Command/_cksum b/Completion/BSD/Command/_cksum deleted file mode 100644 index 4f5b68d8a..000000000 --- a/Completion/BSD/Command/_cksum +++ /dev/null @@ -1,67 +0,0 @@ -#compdef cksum sum=cksum md2 md4 md5 rmd160 sha1 sha256 sha384 sha512 sha512t256 - -if [[ $OSTYPE == (dragonfly|freebsd)* && service == cksum ]]; then - _arguments -s -S -A '-*' \ - '-o[use specified historic algorithm]:historic algorithm:(1 2 3)' \ - '*:_files' - -else - local -a args - - case $OSTYPE in - dragonfly*|freebsd*|netbsd*) - args+=( - '-t[run built-in time trial]' - ) - ;| - dragonfly*|freebsd*|openbsd*) - args+=( - '-r[reverse the output format]' - ) - ;| - dragonfly*) - args+=( - '-b+[begin at specified offset]:begin offset: ' - '-e+[end at specified offset]:end offset: ' - ) - ;; - freebsd*) - args+=( - '-c+[compare digest against specified string]:digest string: ' - ) - ;; - netbsd*) - args+=( - '(*)-c+[compare checksums against specifed sumfile]:sumfile:_files' - '-n[reverse the output format]' - '-w[warn on malformed checksum files]' - ) - if [[ $service == cksum ]]; then - args=( - '(-o)-a+[use the specfied algorithm(s)]:algorithm:(crc md2 md4 md5 old1 old2 rmd160 sha1 sha256 sha384 sha512)' - '(-a)-o+[use the specfied historic algorithm]:historic algorithm:(1 2)' - ) - fi - ;; - openbsd*) - args+=( - '-b[output in base 64]' - '-C+[compare checksums against specifed checklist]:checklist:_files' - '-c[file arguments are checklists]' - '-h+[output to specified hashfile]:hashfile:_files' - '*-t[run built-in time trial]' - ) - if [[ $service == cksum ]]; then - args+=('*-a+[use the specfied algorithm(s)]:algorithm:_values -s , algotithm cksum md5 rmd160 sha1 sha224 sha256 sha384 sha512/256 sha512') - fi - ;; - esac - - _arguments -s -S -A '-*' \ - $args \ - '-p[echo stdin to stdout]' \ - '-q[quiet mode]' \ - '-s+[checksum specified string]:string: ' \ - '-x[run built-in test]' \ - '*:_files' -fi diff --git a/Completion/BSD/Command/_cu b/Completion/BSD/Command/_cu index 90447c0af..1fe08601f 100644 --- a/Completion/BSD/Command/_cu +++ b/Completion/BSD/Command/_cu @@ -1,26 +1,67 @@ #compdef cu -local args +local variant ign +local -a args -case $OSTYPE in +_pick_variant -r variant taylor='Taylor UUCP' $OSTYPE --version + +case $variant in openbsd*) args+=( "-d[don't block waiting for a carrier to be detected]" '-r[start cu in restricted mode - prevent local operations]' ) ;; + taylor|(net|free)bsd*) + args+=( + '(-o -P --parity)-e[use even parity]' + '(-e -P --parity)-o[use odd parity]' + ) + ;| (net|free)bsd*) + args+=( '-t[connect via a hard-wired connection to a host on a dial-up line]' ) + ;| + taylor|netbsd*) + (( $#words > 2 )) && ign='!' + args+=( + "${ign}--help[display usage information]" + '(-s)--speed=[set line speed for the connection]:line speed [9600]:_baudrates' + '(-e -o -P)--parity=[set parity]:parity [none]:(even odd none)' + '(-h --halfduplex)'{-h,--halfduplex}'[echo characters locally]' + '--nostop[turn off XON/XOFF handling]' + '(-E --escape)'{-E+,--escape=}'[specify escape character]:escape character [~]' + '(-a -p --port)'{-a+,-p+,--port=}'[specify the port]:port' + '(-c --phone -n --prompt)'{-c+,--phone=}'[specify phone number to call]:phone number' + '(1 -l -z --system)--line=[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))' + ) + ;| + taylor) args+=( + "${ign}(-v --version)"{-v,--version}"[display version information]" + '(-n --prompt -c --phone)'{-n,--prompt}'[prompt for the phone number to use]' + '(-x --debug)-d[enter debugging mode]' + '(-d -x --debug)'{-x+,--debug=}'[turn on particular debugging types]:debug type:_sequence compadd - all abnormal chat handshake port config incoming outgoing' + '(-I --config)'{-I+,--config=}'[specify configuration file]:configuration file:_files' + '(1 -z --system)'{-z+,--system=}'[specify system to call]:system' + ) + ;; + netbsd*) + args+=( + '(-E --escape)-n+[disable escape character processing]' + '(-f -F --flow)'{-F+,--flow=}'[set flow control]:flow control:(hard soft none)' + '(-F --flow)-f[use no flow control]' + '(-e -o --parity)-P+[set parity]:parity [none]:(even odd none)' + ) + ;; + freebsd*) + args=( -A "-*" $args '-a[set the acu port]:acu' - '(-o)-e[use even parity]' '-h[echo characters locally]' - '(-e)-o[use odd parity]' - '-t[connect via a hard-wired connection to a host on a dial-up line]' ) ;; esac -_arguments -s -A '-*' $args \ - '-l[line to use]:line:(/dev/(cuaU#<->|ttyS<->)(N%c))' \ - '-s[line speed]:line speed:_baudrates' \ - '(-*)1:host:' +_arguments -s $args \ + '(--speed)-s+[set line speed for the connection]:line speed [9600]:_baudrates' \ + '(1 --line -z --system)-l+[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))' \ + '1: :_guard "^-*" system' diff --git a/Completion/BSD/Command/_ldap b/Completion/BSD/Command/_ldap new file mode 100644 index 000000000..8fa17e2f8 --- /dev/null +++ b/Completion/BSD/Command/_ldap @@ -0,0 +1,87 @@ +#compdef ldap + +local -a commands scopes +commands=( + search:'search a directory' +) +scopes=( + base:'base object only' + one:'one level' + sub:subtree +) + +_ldap_url() { + local nm=$compstate[nmatches] + local -a expl protocols suf_proto suf_scope tags + protocols=( + ldap:'TCP in plaintext' + ldaps:'TLS' + ldap+tls:'TCP and use StartTLS' + ldapi:'connect to a socket' + ) + + # [protocol://]host[:port][/basedn[?[attribute,...][?[scope][?[filter]]]]] + if ! compset -P '*://'; then + tags=(protocol) + compset -S ':*' || suf_proto=( -S :// ) + fi + + if ! compset -P '*/'; then + if compset -P '*:'; then + tags=(port) + compset -S '/*' + else + if ! compset -S '://*'; then + tags+=(host) + compset -S '[:/]*' + fi + fi + else + case $PREFIX in + *\?*\?*\?*) tags=(filter);; + *\?*\?*) tags=(scope); [[ -suffix \?* ]] || suf_scope=( -qS \? );; + *\?*) tags=(attribute);; + *) tags=(basedn);; + esac + compset -P '*\?' + compset -S '\?*' + fi + + _tags $tags + while _tags; do + _requested protocol && _describe -t protocol protocol protocols $suf_proto + _requested host && _hosts -S '' + _requested port expl port + _requested basedn expl 'base DN' + _requested attribute expl attribute + _requested scope && _describe -t scope scope scopes $suf_scope + _requested filter expl filter + [[ nm -ne compstate[nmatches] ]] && return 0 + done +} + +if (( CURRENT == 2 )); then + _describe command commands +else + shift words; (( CURRENT-- )) + case $words[1] in + search) + _arguments -s -S -A '-*' \ + '-b+[specify base DN]:base DN:' \ + '-c+[specify CA file]:CA file:' \ + '-D+[specify bind DN]:bind DN:' \ + '-H+[specify URL]: :_ldap_url' \ + '-L[output in LDIF]' \ + '-l+[specify time limit or 0 for no limit]:time limit [0]:' \ + '-s+[specify scope]:scope [sub]:(($scopes))' \ + '-v[be verbose]' \ + '-W[prompt for bind secret]' \ + '-w+[specify bind secret]:bind secret:' \ + '-x[use simple authentication]' \ + '-Z[use StartTLS]' \ + '-z+[specify maximum number of results or 0 for no limit]:size limit [0]:' \ + '::filter:' \ + '*:attribute:' + ;; + esac +fi diff --git a/Completion/BSD/Command/_powerd b/Completion/BSD/Command/_powerd index 18a9fb437..05c03ab15 100644 --- a/Completion/BSD/Command/_powerd +++ b/Completion/BSD/Command/_powerd @@ -6,6 +6,8 @@ _arguments -s \ "-a[mode to use while on AC power]:mode:($powerd_mode)" \ "-b[mode to use while on battery power]:mode:($powerd_mode)" \ '-i[CPU idle percent level when begin to degrade performance]:percent:' \ + '-m[minimum frequency to throttle down to]:frequency (MHz)' \ + '-M[maximum frequency to throttle up to]:frequency (MHz)' \ "-n[mode to use normally when the AC line state is unknown]:mode:($powerd_mode)" \ '-p[polling interval (in milliseconds) for AC line state and system idle levels]:interval:' \ '-P[alternative pidfile]:pidfile:_files' \ diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat index 35b842188..73533e864 100644 --- a/Completion/BSD/Command/_systat +++ b/Completion/BSD/Command/_systat @@ -16,6 +16,7 @@ case $OSTYPE in 'vmstat:virtual memory statistics' 'netstat:network connection statistics' 'ifstat:network traffic statistics' + 'zarc:display arc cache usage' ) ;; openbsd*) diff --git a/Completion/BSD/Command/_watch-snoop b/Completion/BSD/Command/_watch-snoop index 182b6bb34..1a4af07cc 100644 --- a/Completion/BSD/Command/_watch-snoop +++ b/Completion/BSD/Command/_watch-snoop @@ -10,4 +10,4 @@ _arguments -w -S -s : \ "-o[reconnect on overflow]" \ "-t[print date and time at start]" \ "-W[allow write access to observed tty]" \ - ":tty device:_ttys -D" + "(-): : _ttys -Do" |