summaryrefslogtreecommitdiff
path: root/Completion/BSD/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/BSD/Command')
-rw-r--r--Completion/BSD/Command/_bsd_pkg48
-rw-r--r--Completion/BSD/Command/_freebsd-update2
-rw-r--r--Completion/BSD/Command/_ipfw325
-rw-r--r--Completion/BSD/Command/_kdump84
-rw-r--r--Completion/BSD/Command/_ktrace30
-rw-r--r--Completion/BSD/Command/_pfctl2
-rw-r--r--Completion/BSD/Command/_pkgin2
-rw-r--r--Completion/BSD/Command/_portmaster14
-rw-r--r--Completion/BSD/Command/_rcctl15
-rw-r--r--Completion/BSD/Command/_signify1
-rw-r--r--Completion/BSD/Command/_sysclean6
-rw-r--r--Completion/BSD/Command/_sysmerge6
-rw-r--r--Completion/BSD/Command/_syspatch7
-rw-r--r--Completion/BSD/Command/_sysrc2
-rw-r--r--Completion/BSD/Command/_systat10
-rw-r--r--Completion/BSD/Command/_sysupgrade9
-rw-r--r--Completion/BSD/Command/_usbconfig63
17 files changed, 588 insertions, 38 deletions
diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg
index 25d4f346a..82cf6226c 100644
--- a/Completion/BSD/Command/_bsd_pkg
+++ b/Completion/BSD/Command/_bsd_pkg
@@ -78,12 +78,12 @@ _bsd_pkg() {
;;
openbsd*)
flags+=(
- '-A[arch to assume for any package tests]:architecture:_obsd_architectures'
+ '-A+[arch to assume for any package tests]:architecture:_obsd_architectures'
'-a[do not record packages as installed manually]'
'-aa[force already installed packages to be tagged as installed automatically]'
- '-B[specify destdir prefix]:destdir directory:_files -/'
+ '-B+[specify destdir prefix]:destdir directory:_files -/'
'-c[while replacing packages, delete extra configuration file in the old package]'
- '-D[specify failsafe to waive]:failsafe:((
+ '*-D+[specify failsafe to waive]:failsafe:((
allversions\:"do not trim older p* variants of packages for updates"
arch\:"architecture recorded in package may not match"
checksum\:"verify checksums before deleting or tying old files"
@@ -91,9 +91,7 @@ _bsd_pkg() {
donttie\:"do not try to find new files in old packages by comparing the stored sha256"
downgrade\:"do not filter out package versions older than what is currently installed"
installed\:"in update mode, reinstall an existing package with the same update signature"
- libdepends\:"library specifications may not be fulfilled"
nonroot\:"install even if not running as root"
- paranoid\:"do not run any @exec/@unexec"
repair\:"attempt to repair installed packages with missing registration data"
scripts\:"external scripts may fail"
SIGNER\:"list of trusted signers, separated by commas"
@@ -103,10 +101,10 @@ _bsd_pkg() {
))'
'-I[force non-interactive mode]'
'-i[force interactive mode]'
- '-L[specify a localbase]:localbase:_files -/'
- '-l[specify pkg_info output file to install]:pkg_info file:_files'
+ '-L+[specify a localbase]:localbase:_files -/'
+ '-l+[specify pkg_info output file to install]:pkg_info file:_files'
'-m[always display progress meter]'
- '-P[check distribution permissions]:permission type:(cdrom ftp)'
+ '-P+[check distribution permissions]:permission type:(ftp)'
"-qq[don't check checksums]"
'-r[replace existing packages]'
"-s[don't install; just report disk size changes]"
@@ -143,25 +141,28 @@ _bsd_pkg() {
case "$OSTYPE" in
netbsd*)
flags+=(
- '(:)-a[delete all installed packages]'
+ '(:)-A[remove automatically installed packages that are no longer required]'
"-D[don't execute deinstallation scripts]"
'-F[specify each package by an installed file]'
'-f[force deinstallation]'
- '-K[override PKG_DBDIR]:pkg_dbdir:_files -/'
+ '-ff[force deinstallation even if preserved]'
+ '-K+[override PKG_DBDIR]:pkg_dbdir:_files -/'
+ '-k[silently skip preserved packages]'
+ '-N[leave the files installed]'
"-O[only delete the package's entries]"
- '-P[specify destdir prefix]:destdir directory:_files -/'
- '-p[specify prefix]:prefix directory:_files -/'
+ '-P+[specify destdir prefix]:destdir directory:_files -/'
+ '-p+[specify prefix]:prefix directory:_files -/'
'-R[delete upward recursively]'
'-r[delete recursively]'
'-V[show version and exit]'
- '(-a)*:package name:_bsd_pkg_pkgs_and_files'
+ '*:package name:_bsd_pkg_pkgs_and_files'
)
;;
openbsd*)
flags+=(
'-a[delete unused dependencies]'
- '-B[specify destdir prefix]:destdir directory:_files -/'
- '-D[specify failsafe to waive]:failsafe:((
+ '-B+[specify destdir prefix]:destdir directory:_files -/'
+ '*-D+[specify failsafe to waive]:failsafe:((
baddepend\:"force deletion of packages even if they reference nonexistent dependencies"
checksum\:"verify checksums before deleting or tying old files"
dependencies\:"delete the set of packages that depend upon the requested packages"
@@ -189,11 +190,11 @@ _bsd_pkg() {
'(:)-a[show all installed packages]'
'-c[show comment fields]'
'-d[show long descriptions]'
- '-e[test if package is installed]:package name:_bsd_pkg_pkgs'
+ '-e+[test if package is installed]:package name:_bsd_pkg_pkgs'
'-f[show packing list instructions]'
'-I[show index lines]'
'-L[show full pathnames of files]'
- '-l[specify prefix string]:prefix string:'
+ '-l+[specify prefix string]:prefix string:'
'-q[be quiet]'
'-R[show list of installed requiring packages]'
'-s[show total size occupied by each package]'
@@ -209,13 +210,13 @@ _bsd_pkg() {
'-D[show install-message files]'
'-F[specify each package by an installed file]'
'-i[show install scripts]'
- '-K[override PKG_DBDIR]:pkg_dbdir:_files -/'
+ '-K+[override PKG_DBDIR]:pkg_dbdir:_files -/'
'-k[show deinstall scripts]'
'-m[show mtree files]'
'-N[show which packages each package was built with]'
'-n[show which packages each package needs]'
'-p[show installation prefixes]'
- '-Q[show the definition of the specified variable from the build information]:variable:'
+ '-Q+[show the definition of the specified variable from the build information]:variable:'
'-r[show list of installed requiring packages recursively]'
'-S[show total size occupied by each package and its dependents]'
'-u[show information for all user-installed packages]'
@@ -227,14 +228,19 @@ _bsd_pkg() {
flags+=(
'(:)-A[show all installed packages, including internal packages]'
'-C[show certificate information]'
+ '*-D+[specify failsafe to waive]:failsafe:((
+ SIGNER\:"list of trusted signers, separated by commas"
+ snap\:"force %c and %m to expand to snapshots"
+ unsigned\:"allow the installation of unsigned packages without warnings/errors"
+ ))'
'-E[show the package that contains the specified file]:file:_files'
# XXX only with -L
'-K[prefix filenames with category keywords]'
'-M[show the install-message file]'
'-m[only show manual installations]'
'-P[show the pkgpath]'
- '-Q[show packages matching the specified query]:query:'
- '-r[check the list of packages for a specified pkgspec]:pkgspec:'
+ '-Q+[show packages matching the specified query]:query:'
+ '-r+[check the list of packages for a specified pkgspec]:pkgspec:'
'-S[show the update signature]'
'-t[show packages not required by any other]'
'-U[show the deinstall-message file]'
diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update
index d42457272..7dd907298 100644
--- a/Completion/BSD/Command/_freebsd-update
+++ b/Completion/BSD/Command/_freebsd-update
@@ -5,9 +5,11 @@ flags=(
'(cron)fetch[fetch a compressed snapshot or update existing one]'
'(fetch)cron[sleep rand(3600) seconds, and then fetch updates]'
'(install rollback)upgrade[fetch files necessary for upgrading to a new release]'
+ 'updatesready[check if there are fetched updates ready to install]'
'(upgrade rollback)install[install the most recently fetched updates or upgrade]'
'(upgrade install)rollback[uninstall the most recently installed updates]'
'IDS[compare the system against an index of "known good" files]'
+ 'showconfig[show configuration options after parsing conffile and command line options]'
)
_arguments \
diff --git a/Completion/BSD/Command/_ipfw b/Completion/BSD/Command/_ipfw
new file mode 100644
index 000000000..49d0ef1e8
--- /dev/null
+++ b/Completion/BSD/Command/_ipfw
@@ -0,0 +1,325 @@
+#compdef ipfw
+
+local word=$'/[^ \t\0]#[ \t\0]/' comma next pqs nat
+local -a actions address pathname ropts ca
+local -A opt_args nat_options
+
+_ipfw_tables() {
+ local -a expl match opts all
+ zparseopts -D -E -a opts M+: x+: X+: J+: V+: o+: 1 2 a=all
+ _description -x ipfw-tables expl 'table'
+ match=( ${${${(M)${(f)"$(_call_program ipfw-tables
+ ipfw table all info 2>/dev/null)"}:#-*}#*\(}%%\)*} )
+ if (( $#all )); then
+ match+=( all )
+ compadd -D match -a match
+ [[ $#PREFIX -eq 0 && $#match -eq 1 && $match[1] = all ]] && compstate[insert]=''
+ fi
+ compadd "$opts[@]" "$expl[@]" "$@" -a match
+}
+
+_ipfw_rules() {
+ local -a rules
+ rules=( ${${(f)"$(_call_program ipfw-rules ipfw list)"}/ /:} )
+ _describe -x -t ipfw-rules rule rules "$@"
+}
+
+ropts=( # rule options
+ bridged
+ defer-{immediate-,}action diverted{,-loopback,-output}
+ dst-{ip{,6,v6},port} established ext6hdr
+ fib flow flow-id frag gid jail
+ icmptypes icmp6types in out
+ ipid iplen ipoptions ipprecedence ipsec iptos dscp ipttl ipversion
+ keep-state layer2 limit lookup
+ MAC mac-type proto record-state recv xmit via
+ set-limit setup sockarg
+ src-{ip,ip6,port} tagged
+ tcpack tcpdatalen tcpflags tcpmss tcpseq tcpwin tcpoptions
+ uid verrevpath versrcreach antispoof
+)
+
+nat_options=(
+ nat64lsn "prefix4 prefix6 states_chunk host_del_age pg_del_age tcp_syn_age tcp_est_age tcp_close_age udp_age icmp_age log -log allow_private -allow_private"
+ nat64stl "prefix6 table4 table6 log -log allow_private -allow_private"
+ nat64clat "clat_prefix plat_prefix log -log allow_private -allow_private"
+ nptv6 "int_prefix ext_prefix ext_if prefixlen"
+)
+
+ca=( compadd -S " " -r " $compstate[quote]\t\n\-" )
+
+address=(
+ \( $'/not[ \t\0]/' ':operators:operator:$ca not' \| \)
+ \( $'/(any|me|me6)[ \t\0]/' ':addresses:address:$ca any me me6'
+ \| '/table??/' ':tables:table:compadd -S "" -s\( table'
+ $word ':tables:table:_ipfw_tables -s\) -S ""'
+ \| // -'comma=0'
+ \(
+ // -'(( ! comma ))'
+ \( $'/[^, \t\0]#/' $'%[, \t\0]%' ':hosts:ip or host:_hosts -S, -r "/: \t\n\-"'
+ \| $'/[^},/:]##//' '/[]/' ': _message -e numbers "mask length"'
+ \| $'/[^},/:]##:/' '/[]/' ': _message -e numbers "mask"'
+ \| $'/([0-9]##.)(#c3)[0-9]##/' '/[]/' ':symbols:symbol:compadd -S "" / : ,'
+ \| // '%[1-9]%' '/[]/' ': _message -e ip-addresses "IP address"' \)
+ \( /,/ -'comma=0' \| // -'comma=1' \)
+ $'/([ \t\0]|)/'
+ \) \#
+ // -'(( comma ))'
+ \)
+)
+address=(
+ \( $'/[({][ \t]\0/' -'next=1' ':symbols:symbol:$ca - {'
+ \( // -'(( next ))' $address
+ \( $'/or[ \t\0]/' -'next=1' ':symbols:symbol:$ca - or \}' \| // -'next=0' \)
+ \) \#
+ $'/[})][ \t\0]/'
+ \| $address \)
+ \(
+ \( $'/not[ \t\0]/' ':specifiers:specifier:$ca - not' \| \)
+ $word -$'[[ $match != to? && -z ${(M)ropts:#${match%?}} ]]' ':ports:port:_sequence _ports'
+ \| \)
+)
+
+actions=(
+ $'/[^\0]##\0(-[a-zA-Z0-9]##[ \t]#)#/' # skip over options, completed by _arguments but can
+ \( # be quoted in one argument which that doesn't handle
+ $'/add[ \t\0]/' ':firewall-commands:firewall configuration:$ca add'
+ \( $'/<->[ \t\0]/' ': _guard "[0-9]#" "rule number (00000-65535)"' \| \)
+ \( $'/set[ \t\0]/' ':specifiers:specifier:$ca set' $word ':sets:set:$ca -o numeric {0..31}' \| \)
+ \( $'/prob[ \t\0]/' ':specifiers:specifier:$ca prob' $word ': _message -e probabilities "match probability (0.0-1.0)"' \| \)
+ \( # rule actions
+ $'/check-state[ \t\0]/' $word ': _message -e flow-names "flow name"'
+ \|
+ \( $'/(divert|tee)[ \t\0]/' $word ': _message -e ports port'
+ \| $'/(fwd|forward)[ \t\0]/'
+ \( $word ': _guard "[0-9]#" "ip address"'
+ \| '/[^\0]#,/' ':specials:special:compadd -qS, tablearg'
+ $word ':ports:port:_ports -qS " "' \)
+ \| $'/(nat*|nptv6)[ \t\0]/'
+ \( $word ': _guard "[0-9]#" "nat instance"'
+ \| $word ':specials:special:$ca global tablearg' \)
+ \| $'/pipe[ \t\0]/' $word ': _message -e pipes "dummynet pipe"'
+ \| $'/queue[ \t\0]/' $word ': _message -e queues "dummynet queue"'
+ \| $'/(skipto|call)[ \t\0]/' \( /t/+ $word ':specials:special:$ca tablearg' \| '/[]/' ':ipfw-rules:rule:_ipfw_rules -qS " "' \)
+ \| $'/unreach[ \t\0]/' $word ':codes:code:$ca net host protocol port needfrag srcfail net-unknown host-unknown isolated net-prohib host-prohib tosnet toshost filter-prohib host-precedence precedence-cutoff'
+ \| $'/unreach6[ \t\0]/' $word ':codes:code:$ca no-route admin-prohib address port'
+ \| $'/(netgraph|ngtee)[ \t\0]/' $word ': _message -e cookies cookie'
+ \| $'/setfib[ \t\0]/' \( $word ': _guard "[0-9]#" "routing table"' \| '/[]/' ':specials:special:$ca tablearg' \)
+ \| $'/setdscp[ \t\0]/' \( $word ':dscps:dscp:$ca cs{0..7} af{1,2,3,4}{1,2,3} ef be' \| '/[]/' ':specials:special:$ca tablearg' \)
+ \| $'/tcp-setmss[ \t\0]/' $word ': _message -e mss mss'
+ \| $word \)
+ \( $'/log[ \t\0]/' ':specifiers:specifier:$ca log'
+ \( $'/logamount[ \t\0]/' ':specifiers:specifier:$ca logamount' $word ': _message -e limits "maximum count"' \| \)
+ \| \)
+ \( $'/altq[ \t\0]/' ':specifiers:specifier:$ca altq' $word ': _message -e queues queue' \| \)
+ \( $'/(tag|untag)[ \t\0]/' ':specifiers:specifier:$ca tag untag' $word ': _message -e numbers "tag (1-65534)"' \| \)
+ # rule body
+ \( \( $'/not[ \t\0]/' ':operators:operator:$ca not' \| \)
+ $'/(ip(v|)(4|6|)|all|icmp|ip|tcp|udp|sctp)[ \t\0]/' ':protocols:protocol:$ca ip ip4 ipv4 ip6 ipv6 all icmp tcp udp sctp'
+ $'/from[ \t\0]/' ':specifiers:specifier:$ca from'
+ $address
+ $'/to[ \t\0]/' ':specifiers:specifier:$ca to'
+ $address
+ \| \)
+ # rule options
+ \( $'///[ \t\0]/' ':rule-options:rule option:((//\:comment))' // ': _message -e comments comment'
+ \| $'/(dst|src)-ip(|6|v6)[ \t\0]/' $word ': _message -e addresses address'
+ \| $'/(dst|src)-port[ \t\0]/' $word ':ports:port:_sequence _ports'
+ \| $'/ext6hdr[ \t\0]/' $word ':headers:extended header:_sequence compadd - frag hopopt route rthdr0 rthdr2 dstopt ah esp'
+ \| $'/fib[ \t\0]/' $word ': _message -e routing-tables "routing table"'
+ \| $'/flow[ \t\0]/' '/table??/' ':tables:table:compadd -S "" -s\( table'
+ $word ':tables:table:_ipfw_tables -s\) -S ""'
+ \| $'/flow-id[ \t\0]/' $word ': _message -e flow-labels "flow label"'
+ \| $'/frag[ \t\0]/' $word ':fragmentation options:fragmentation option:_sequence compadd - df mf rf offset'
+ \| $'/gid[ \t\0]/' $word ':groups:group:_groups'
+ \| $'/jail[ \t\0]/' $word ':jails:jail:_jails'
+ \| $'/ipoptions[ \t\0]/' $word ':ip-options:ip option:_sequence compadd - ssrr lsrr rr ts'
+ \| $'/iptos[ \t\0]/' $word ':tos-fields:tos field:_sequence compadd - lowdelay throughput reliability mincost congestion'
+ \| $'/(set-|)limit[ \t\0]/' $word ':parameters:parameter to limit:$ca {src,dsr}-{addr,port}'
+ $word ': _message -e numbers "connection limit"'
+ \| $'/lookup[ \t\0]/' $word ':fields:field:$ca {src,dst}-{ip,port} uid jail'
+ $word ': _message -e names name'
+ \| $'/(#i)mac[ \t\0]/' $word ': _message -e mac-addresses "destination mac"'
+ $word ': _message -e mac-addresses "source mac"'
+ \| $'/proto[ \t\0]/' $word ': _message -e protocols "IP protocol"'
+ \| $'/(recv|xmit|via)[ \t\0]/'
+ \( $word ':interfaces:interface:_net_interfaces -qS " "'
+ \| $word ':ipfw-tables:table:_ipfw_tables -qS " "'
+ \| $'/any[ \t\0]/' ':interfaces:interface:$ca any' \)
+ \| $'/tcpflags[ \t\0]/' $word ':tcp-flags:tcp flag:_sequence compadd - fin syn rst psh ack urg'
+ \| $'/tcpoptions[ \t\0]/' $word ':tcp-options:tcp option:_sequence compadd - mss window sack ts cc'
+ \| $'/uid[ \t\0]/' $word ':users:user:_users -qS " "'
+ \| $'/(icmp(|6)types|ipid|iplen|ipprecedence|dscp|ipttl|ipversion|keep-state|mac-type|tagged|tcp(ack|datalen|mss|pack|seq|win))[ \t\0]/' $word ': _message -e values value'
+ \| $word ':rule-options:rule option:$ca -a ropts'
+ \) \#
+ \|
+ '/[]/' ':actions:action:$ca allow check-state count deny divert forward nat nat64lsn nat64stl nat64clat nptv6 pipe queue reset reset6 skipto call return tee unreach unreach6 netgraph setfib ngtee setfib setdscp tcp-setmss reass abort abort6'
+ \)
+ \| $'/set[ \t\0]show[ \t\0]/'
+ \| $'/set[ \t\0]move[ \t\0]/'
+ \( // %r% $'/rule[ \t\0]/' ': $ca rule' \| \)
+ $word ':ipfw-rules: :_ipfw_rules -qS " "'
+ $'/to[ \t\0]/' ': $ca to'
+ $word ':ipfw-rules: :_ipfw_rules'
+ \| $'/set[ \t\0]swap[ \t\0]/'
+ $word ':ipfw-sets:set:$ca -o numeric {0..31}'
+ $word ':ipfw-sets:set:compadd -o numeric {0..31}'
+ \| $'/set[ \t\0]/' '%[ed]%'
+ \(
+ $'/(en|dis)able[ \t\0]/' ':set-commands:set command:$ca -F line enable disable'
+ $'/<->[ \t\0]/' ':ipfw-sets:set:$ca -o numeric {0..31}'
+ $'/<->[ \t\0]/' ':ipfw-sets:set:$ca -o numeric {0..31}' \#
+ \) \#
+ \|
+ \( $'/set[ \t\0]/' ':firewall-commands:firewall configuration:$ca set'
+ \( $'/<->[ \t\0]/' ':sets:set:$ca -o numeric {0..31}'
+ \| '/[]/' ':set-commands:set command:$ca move swap show enable disable' \)
+ \| \)
+ \( $'/(list|show|delete)[ \t\0]/' ':firewall-commands:firewall configuration:$ca list show delete zero resetlog'
+ \( $'/[0-9]##-/' $word ':ipfw-rules: :_ipfw_rules -qS " "'
+ \| $word ':ipfw-rules: :_ipfw_rules -qS "-"' \) \#
+ \| $'/(zero|resetlog)[ \t\0]/' $word ':ipfw-rules: :_ipfw_rules -qS " "' \#
+ \| $'/flush[ \t\0]/' ':firewall-commands:firewall configuration:(flush)'
+ \| $'/table[ \t\0]/' ':commands:command:$ca table'
+ \( # lookup tables
+ $'/all[ \t\0]/' $word ':commands:table command:compadd destroy list info detail flush'
+ \|
+ $word ':tables:table:_ipfw_tables -a -qS " "'
+ \( $'/create[ \t\0]/'
+ \( $'/type[ \t\0]/' $word ':types:type:(addr iface number flow)'
+ \| $'/valtype[ \t\0]([^ \t\0]#,|)/' $word ':value-types:value type:compadd -qS, skipto pipe fib nat dscp tag divert netgraph limit ipv4 ipv6'
+ \| $'/algo[ \t\0]/' $word ':algorithms:lookup algorithm:$ca addr\:radix addr\:hash iface\:array number\:array flow\:hash'
+ \| $'/limit[ \t\0]/' $word ': _message -e numbers "maximum number of items"'
+ \| $word ':options:option:$ca -F line type valtype algo limit locked missing or-flush' \) \#
+ \| $'/modify[ \t\0]/'
+ $'/limit[ \t\0]/' ':options:option:$ca limit'
+ $word ': _message -e numbers "maximum number of items"'
+ \| $'/swap[ \t\0]/'
+ $word ':tables:table:_ipfw_tables -a'
+ \| $'/(atomic[ \t\0]|)add[ \t\0]/' \(
+ $word ': _message -e table-keys "table key"'
+ $word ': _message -e values value' \) \#
+ \| $'/delete[ \t\0]/' $word ': _message -e table-keys "table key"' \#
+ \| $'/lookup[ \t\0]/' $word ': _message -e addresses address'
+ \|
+ '/[]/' ':commands:table command:compadd - destroy lock unlock list info detail flush'
+ \|
+ $word ':commands:table command:$ca -Q - create modify swap add atomic\ add delete lookup'
+ \)
+ \)
+ \| $'/(nat64(lsn|stl|clat)|nptv6)[ \t\0]/' -'nat=${match%?}' ':commands:command:$ca nat64lsn nat64stl nat64clat nptv6'
+ $word ': _message -e names name'
+ \( $'/(config|create)[ \t\0]/'
+ \( $'/[^\0]#prefix([46]|)[ \t\0]/' $word ': _message -e prefixes prefix'
+ \| $'/states_chunks[ \t\0]/' $word ': _message -e numbers number'
+ \| $'/[^\0]#_age[ \t\0]/' ': _message -e seconds "age (seconds)"'
+ \| $'/table[46][ \t\0]/' $word ':ipfw-tables:ipfw table:_ipfw_tables -qS " "'
+ \| $'/ext_if[ \t\0]/' $word ':interfaces:interface:_net_interfaces -qS " "'
+ \| $'/prefixlen[ \t\0]/' ': _message -e lengths length'
+ \| $word ':options:option:$ca -F line $=nat_options[$nat]' \) \#
+ \| $'/(list|show)[ \t\0]/'
+ \( // -'[[ $nat = *lsn]' $word ':states:state:(states)'
+ \| // -'[[ $nat != *lsn]' \)
+ \| $'/stats[ \t\0]/' $word ':commands:command:(reset)'
+ \|
+ $word ':commands:command:$ca create config list show destroy stats'
+ \)
+ \)
+ \| # in-kernel NAT
+ $'/nat[ \t\0]/' ':commands:command:$ca nat'
+ $word ': _message -e numbers "nat instance"'
+ \( $'/config[ \t\0]/'
+ \( $'/if[ \t\0]/' $word ':interfaces:interface:_net_interfaces -qS " "'
+ \| $'/ip[ \t\0]/' $word ': _message -e ip-addresses "ip address"'
+ \| $'/redirect_addr[ \t\0]/'
+ $word ': _message -e ip-addresses "IP address"'
+ $word ': _message -e ip-addresses "IP address"'
+ \| $'/redirect_port[ \t\0]/' $word ':protocols:protocol:$ca sctp tcp udp'
+ '/[^:]##:/' ': _message -e ip-addresses "IP address"'
+ $word ':ports:port:_ports'
+ $word ':ports:port:_sequence _ports'
+ \| $'/redirect_proto[ \t\0]/' $word ':protocols:protocol:$ca sctp tcp udp'
+ $word ': _message -e ip-addresses "IP address"'
+ $word ': _message -e ip-addresses "IP address"'
+ \| $word ':parameters:config parameter:$ca ip if log deny_in same_ports unreg_only unreg_cgn reset reverse proxy_only skip_global redirect_port redirect_addr redirect_proto'
+ \) \#
+ \| $'/show[ \t\0]/' $word ':actions:action:(config log)'
+ \| '/[]/' ':commands:command:$ca config show' \)
+ \| # dummynet configuration
+ $'/(pipe|queue|sched)[ \t\0]/' -'pqs=${match%?}' ':dummynet-commands:dummynet configuration:$ca pipe queue sched'
+ $word ': _message -e numbers number'
+ $word ':options:config:$ca config'
+ \( $'/bw[ \t\0]/'
+ \( $word ':bandwidths: :_numbers -M "m:{a-z}={A-Z}" bandwidth {K,M,G}{bit,Byte}/s'
+ \| $word ':devices:device:_net_interfaces -qS " "' \)
+ \| $'/delay[ \t\0]/' $word ': _message -e numbers "propagation delay (ms)"'
+ \| $'/burst[ \t\0]/' $word ': _message -e numbers "size (bytes)"'
+ \| $'/profile[ \t\0]/' $word ':files:file:_files -qS " "'
+ \| $'/pipe[ \t\0]/' $word ': _message -e pipes pipe'
+ \| $'/weight[ \t\0]/' $word ': _message -e weights "weight (1-100) [1]"'
+ \| $'/type[ \t\0]/-'
+ \( $'/fq_(pie|codel)[ \t\0]/'
+ \( $'/limit[ \t\0]/' $word ': _message -e numbers "limit (packets) [10240]"'
+ \| $'/flows[ \t\0]/' $word ': _message -e numbers "flow queues [1024]"'
+ \| $'/quantum[ \t\0]/' ':parameters:parameter:$ca -F line quantum limit flows' \) \#
+ '/[]/'
+ \| $word ':types:scheduling algorithm:$ca fifo wf2q+ rr qfq fq_codel fq_pie fq_codel' \)
+ \| $'/buckets[ \t\0]/' $word ': _message -e sizes "hash table size (16-65536)"'
+ \| $'/mask[ \t\0]/' $word ':mask-specifiers:mask specifier:$ca dst-ip dst-ip6 src-ip src-ip6 dst-port src-port flow-id proto all'
+ \| $'/plr[ \t\0]/' $word ': _message -e numbers "packet loss rate (0.0-1.0)"'
+ \| $'/queue[ \t\0]/' $word ': _message -e sizes "queue size"'
+ \| $'/(red|gred)[ \t\0]/' $word ': _message -e thresholds thresholds'
+ \| $'/codel[ \t\0]/'
+ \( $'/(target|interval)[ \t\0]/' $word ': _message -e times "time (ms)"'
+ \| $'/(ecn|noecn)[ \t\0]/' ':options:option:$ca -F line target interval ecn noecn' \) \#
+ '/[]/'
+ \| $'/pie[ \t\0]/'
+ \( $'/(target|tupdate|max_burst)[ \t\0]/' $word ': _message -e times "time"'
+ \| $'/(alpha|beta)[ \t\0]/' $word ': _message -e weights weight'
+ \| $'/max_ecnth[ \t\0]/' $word ': _message -e probabilities probability'
+ \| $word ':options:option:$ca -F line alpha beta max_burst max_ecnth {,no}{ecn,capdrop,drand} onoff dre ts' \) \#
+ '/[]/'
+ \| // '-[[ $pqs = pipe ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line bw delay burst profile buckets mask noerror plr queue red gred codel pie'
+ \| // '-[[ $pqs = queue ]]' $'/noerror[ \t\0]/' ':options:option:$ca -F line pipe weight buckets mask noerror plr queue red gred codel pie'
+ \| // '-[[ $pqs = sched ]]' $'/[]/' ':options:option:$ca -F line type bw delay burst profile'
+ \) \#
+ \| # sysctl shortcuts
+ $'/(en|dis)able[ \t\0]/' ':sysctl-shortcuts:sysctl shortcut:$ca enable disable'
+ $word ':values:value:(firewall altq one_pass debug verbose dyn_keepalive)'
+ \|
+ $'/internal[ \t\0]/' ':commands:command:$ca internal'
+ $word ':lists:list:(iflist talist vlist)'
+ \)
+)
+
+if (( $words[(I)-p*] )); then
+ pathname=( ':path:_files -P / -W /' )
+fi
+
+_regex_arguments _ipfw_actions "$actions[@]"
+
+if [[ -prefix *[$' \t']* ]]; then
+ # This allows from things like ipfw "-n add..."
+ _ipfw_actions
+ return
+fi
+
+_arguments -s $pathname \
+ '(-p)-a[show counter values when listing rules (implied by show)]' \
+ '(-p)-b[show only the action and the comment]' \
+ '-c[show rules in compact form]' \
+ '(-p)-d[show dynamic rules in addition to static ones]' \
+ '(-p)-D[act on dynamic states only]' \
+ '-f[run without confirmation]' \
+ '(- *)-h[display syntax summary]' \
+ '(-p)-i[format values as IP addresses in table listings]' \
+ '-n[only check syntax, make no changes]' \
+ '-N[resolve addresses and service names in output]' \
+ '-q[quiet output]' \
+ '-S[show the set each rule belongs to]' \
+ '(-p)-s+[sort pipes by field]:field (negative reverses):((0\:unsorted 1\:packets 2\:bytes 3\:total\ packets 4\:total\ bytes))' \
+ '(-p -T)-t[show timestamp of last match, ctime() format]' \
+ '(-p -t)-T[show timestamp of last match as seconds since epoch]' \
+ '(-a -b -d -D -i -s -t -T *)-p+[specify preprocessor]:preprocessor:_command_names -e' \
+ '*:::actions:= _ipfw_actions'
+
diff --git a/Completion/BSD/Command/_kdump b/Completion/BSD/Command/_kdump
new file mode 100644
index 000000000..e5c7c4cce
--- /dev/null
+++ b/Completion/BSD/Command/_kdump
@@ -0,0 +1,84 @@
+#compdef kdump
+
+_kdump_pid() {
+ local -a args pids
+ local -A assoc_pids
+
+ if (( $+opt_args[-f] )); then
+ args=(-f $opt_args[-f])
+ fi
+ pids=(${${${(f)"$(_call_program kdump-pids kdump $args)"}:#($'\t'| )*}## #})
+ [[ $OSTYPE == netbsd* ]] && pids=(${pids/ ##[0-9]##/})
+ pids=(${(u)${pids/ /:}%% *})
+ for 1 in $pids; do
+ local pid=${1%%:*} process=${1#*:}
+ if (( $+assoc_pids[$pid] )); then
+ assoc_pids[$pid]+=", $process"
+ else
+ assoc_pids[$pid]=$process
+ fi
+ done
+ pids=()
+ for pid procs in ${(kv)assoc_pids}; do
+ pids+=($pid:$procs)
+ done
+ _describe -t kdump-pids 'kdump pid' pids
+}
+
+local args=(
+ '-d[display numbers in decimal]'
+ '-f+[use the specified file (- for stdin)]:dump file:_files'
+ '-l[loop reading the trace file]'
+ '-m+[maximum I/O bytes to display]:max data bytes:'
+ '-n[suppress ad hoc translations]'
+ '-p+[show output only for the specified pid]: :_kdump_pid'
+ '(-E -T)-R[display relative timestamps]'
+ '(-E -R )-T[display absolute timestamps]'
+ '-t[select which tracepoints to display]: :_ktrace_points'
+)
+
+case $OSTYPE; in
+ freebsd*|netbsd*)
+ args+=(
+ '(-R -T)-E[display elapsed timestamps]'
+ )
+ ;|
+ freebsd*|openbsd*)
+ args+=(
+ '-H[display thread identifiers]'
+ )
+ ;|
+ dragonfly*)
+ args+=(
+ '(-c -R)-a[display full human readable output]'
+ '-c[display the CPU the thread is running on]'
+ '-j[use a fixed format output]'
+ )
+ ;;
+ freebsd*)
+ args+=(
+ '-A[display description of the ABI of traced process]'
+ '-r[symbolically display structure members]'
+ '-S[display system call numbers]'
+ '-s[suppress display of I/O data]'
+ )
+ ;;
+ netbsd*)
+ args+=(
+ '-e[interpret system call maps using the specified emulation]:emulation:'
+ '-N[suppress system call name translation]'
+ '-X[Display GIO data in hex and ascii in groups of specified size]:size:(1 2 4 8 16)'
+ '-x[Display GIO data in hex and ascii]'
+ '1:dump file:_files'
+ )
+ ;;
+ openbsd*)
+ args+=(
+ # XXX handle -TR
+ '-X[display I/O data in hex and ASCII]'
+ '-x[display I/O data in hex]'
+ )
+ ;;
+esac
+
+_arguments -s -S -A '-*' : $args
diff --git a/Completion/BSD/Command/_ktrace b/Completion/BSD/Command/_ktrace
new file mode 100644
index 000000000..9613ba2bf
--- /dev/null
+++ b/Completion/BSD/Command/_ktrace
@@ -0,0 +1,30 @@
+#compdef ktrace
+
+local args=(
+ '-a[append to the trace file]'
+ '(*)-C[disable tracing on all user owned processes or all processes if executed by root]'
+ '-c[clear the trace points]'
+ '-d[trace current descendants]'
+ '-f+[log trace to specified file]:trace file:_files'
+ '(-p *)-g+[enable/disable tracing on specified process group]:pgid:_pgids'
+ '-i[inherit trace flags on future children]'
+ '(-g *)-p+[enable/disable tracing on specified PID]: :_pids'
+ '-t+[select information to include in dump]:trace string:_ktrace_points'
+ '*:: : _normal -p ktrace'
+)
+
+case $OSTYPE; in
+ openbsd*)
+ args+=(
+ '-B[process relocations immediately]'
+ )
+ ;;
+ netbsd*)
+ args+=(
+ '-n[stop tracing if writes to the trace file would block]'
+ '-s[write to the trace file with synchronized I/O]'
+ )
+ ;;
+esac
+
+_arguments -s -S -A '-*' : $args
diff --git a/Completion/BSD/Command/_pfctl b/Completion/BSD/Command/_pfctl
index 23898882f..812e52bdb 100644
--- a/Completion/BSD/Command/_pfctl
+++ b/Completion/BSD/Command/_pfctl
@@ -66,7 +66,7 @@ case $OSTYPE in
"-N[don't perform domain name resolution]"
'-P[display ports using service names]'
'-S+[store pf state table in the specified file]:file:_files'
- '-V+[select routing domain to be used to kill states]:routing domain'
+ '-V+[select routing domain to be used to kill states]:routing domain:_routing_domains'
)
;;
(free|net)bsd*)
diff --git a/Completion/BSD/Command/_pkgin b/Completion/BSD/Command/_pkgin
index 5cb12baea..662bed181 100644
--- a/Completion/BSD/Command/_pkgin
+++ b/Completion/BSD/Command/_pkgin
@@ -26,7 +26,7 @@ _arguments -s -S -C \
'*:: :->restargs' && ret=0
if [[ -n $state ]]; then
- cmds=( ${${${(f)"$(_call_program commands $pkgin -h 2>&1)"}[3,-1]/ - (#b)(?)/:$match:l}%.} )
+ cmds=( ${${${(f)"$(_call_program commands $pkgin -h 2>&1)"}[3,-1]/ - (#b)(?)/:$match:l}%.} )
short=( ${${cmds#*\(}/ #\)/} )
cmds=( ${cmds// #\(*\)/} )
if [[ $state = subcommands && ! -prefix - ]]; then
diff --git a/Completion/BSD/Command/_portmaster b/Completion/BSD/Command/_portmaster
index 48390c9ad..ee6fefc6e 100644
--- a/Completion/BSD/Command/_portmaster
+++ b/Completion/BSD/Command/_portmaster
@@ -8,11 +8,11 @@ _portmaster_ports() {
local expl ret=1 _fbsd_ports _fbsd_cat
_fbsd_cat=(${PORTSDIR:-/usr/ports}/[a-z]*(/:t))
if [[ $PREFIX != */* ]] ; then
- _wanted cat_packages expl 'category/ports' compadd -S '/' $_fbsd_cat
+ _wanted cat_packages expl 'category/port' compadd -S '/' $_fbsd_cat
else
compset -P '*/'
_fbsd_ports=(${PORTSDIR:-/usr/ports}/$IPREFIX/*(/:t))
- _wanted cat_packages expl 'category/ports' compadd $_fbsd_ports
+ _wanted cat_packages expl 'category/port' compadd $_fbsd_ports
fi
return ret
}
@@ -77,7 +77,7 @@ _portmaster() {
_arguments -s \
$standalone_args \
$common_args \
- '*:packages and ports:_portmaster_pkgs_and_ports'
+ '*:package or port:_portmaster_pkgs_and_ports'
else
case "$words[2]" in
--clean-distfiles|--clean-distfiles-all|--check-depends|--check-port-dbdir|--version|-help|-h)
@@ -86,14 +86,14 @@ _portmaster() {
*)
if (( $words[(I)-(e|r)] ));then
_arguments -s \
- '*:packages:_portmaster_pkgs'
+ '*:package:_portmaster_pkgs'
elif (( kid=$words[(I)-o] ));then
if (( CURRENT == $kid + 1 ));then
_arguments -s \
- '*:ports replacing:_portmaster_ports'
+ '*:replacement port:_portmaster_ports'
elif (( CURRENT == $kid + 2 )); then
_arguments -s \
- '*:package to replace:_portmaster_pkgs'
+ '*:package to replace:_portmaster_pkgs'
else
return 0
fi
@@ -102,7 +102,7 @@ _portmaster() {
else
_arguments -s \
$common_args \
- '*:packages and ports:_portmaster_pkgs_and_ports'
+ '*:package or port:_portmaster_pkgs_and_ports'
fi
;;
esac
diff --git a/Completion/BSD/Command/_rcctl b/Completion/BSD/Command/_rcctl
index 62cb8f634..6cfebf420 100644
--- a/Completion/BSD/Command/_rcctl
+++ b/Completion/BSD/Command/_rcctl
@@ -1,11 +1,20 @@
#compdef rcctl
local context state line
-local -a actions subcmds variables
+local -a actions lsarg subcmds variables
actions=(check reload restart start stop)
subcmds=(disable enable get getdef ls order set)
variables=(class flags status timeout user)
+lsarg=(
+ 'all:all services and daemons'
+ 'failed:enabled but stopped daemons'
+ 'off:disabled services and daemons'
+ 'on:enabled services and daemons'
+ 'rogue:daemons which are disabled but currently running'
+ 'started:running daemons'
+ 'stopped:stopped daemons'
+)
if [[ $service == "rcctl" ]]; then
_arguments -C \
@@ -23,11 +32,11 @@ case $service in
':variable:compadd -a variables'
;;
ls)
- _arguments ':display a list of services and daemons matching:(all failed off on started stopped)'
+ _arguments ':display a list of services and daemons matching:(($lsarg))'
;;
order)
_arguments \
- ':service to start first:_services'
+ ':service to start first:_services' \
'*:service to start next:_services'
;;
set)
diff --git a/Completion/BSD/Command/_signify b/Completion/BSD/Command/_signify
index 6a786e2e1..91e97e811 100644
--- a/Completion/BSD/Command/_signify
+++ b/Completion/BSD/Command/_signify
@@ -5,6 +5,7 @@ _arguments -s -S -A "-*" : \
'-C[verify a signed checksum list and the checksum for each file]' \
'-p+[public key]:public key:_files' \
'-q[quiet mode]' \
+ '-t+[specify key type]:key type' \
'-x+[specify signature file]:signature file:_files' \
'*:file:_files' \
- generate \
diff --git a/Completion/BSD/Command/_sysclean b/Completion/BSD/Command/_sysclean
new file mode 100644
index 000000000..755861644
--- /dev/null
+++ b/Completion/BSD/Command/_sysclean
@@ -0,0 +1,6 @@
+#compdef sysclean
+
+_arguments -s : \
+ '(-p)-a[include filenames used by installed packages]' \
+ '-i[include ignored filenames]' \
+ '(-a)-p[output package names that are using obsolete files]'
diff --git a/Completion/BSD/Command/_sysmerge b/Completion/BSD/Command/_sysmerge
new file mode 100644
index 000000000..00ee18299
--- /dev/null
+++ b/Completion/BSD/Command/_sysmerge
@@ -0,0 +1,6 @@
+#compdef sysmerge
+
+_arguments -s : \
+ '-b[run non-interactively]' \
+ '-d[do not take any automatic action]' \
+ '-p[only compare configuration of packages]'
diff --git a/Completion/BSD/Command/_syspatch b/Completion/BSD/Command/_syspatch
new file mode 100644
index 000000000..850636d09
--- /dev/null
+++ b/Completion/BSD/Command/_syspatch
@@ -0,0 +1,7 @@
+#compdef syspatch
+
+_arguments \
+ '( -l -R -r)-c[list available patches]' \
+ '(-c -R -r)-l[list installed patches]' \
+ '(-c -l -r)-R[revert all patches]' \
+ '(-c -l -R )-r[revert the most recently installed patch]'
diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc
index f0c12a2be..892dac407 100644
--- a/Completion/BSD/Command/_sysrc
+++ b/Completion/BSD/Command/_sysrc
@@ -29,7 +29,7 @@ _sysrc() {
'(- *)-h[print short usage message]' \
'(- *)--help[print full usage message]' \
'-i[ignore unknown variables]' \
- '-j+[jail to operate within]:jails:_jails' \
+ '-j+[jail to operate within]:jail:_jails' \
'-n[print only variable values]' \
'-N[print only variable names]' \
'-R+[specify an alternative root]:alternative root:_files -/' \
diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat
index 73533e864..03df07631 100644
--- a/Completion/BSD/Command/_systat
+++ b/Completion/BSD/Command/_systat
@@ -45,6 +45,7 @@ case $OSTYPE in
'-B[raw, non-interactive mode (two screen updates)]'
'-b[raw, non-interactive mode (one screen update)]'
'-d[exit after `count'\'' updates]:count'
+ '-h[human readable output]'
'-i[interactive mode]'
'-N[resolve network addresses to names]'
'-n[do not resolve network addresses to names]'
@@ -74,15 +75,16 @@ case $OSTYPE in
opts=(
'-M[alternative source to extract values from]:core:_files'
'-N[alternative source to extract the name list from]:system:_files'
- '-n[do not resolve IP addresses]'
- '-w[refresh interval]:refresh interval'
- '-t[the amount of refreshes for each screen in '\''all'\'' display mode]:turns'
+ '(-t -w)-b[show the chosen display once and exit]'
+ "-n[don't resolve IP addresses]"
+ '(-b)-w[refresh interval]:refresh interval'
+ "(-b)-t[specify amount of refreshes for each screen in 'all' display mode]:turns"
)
esac
if (( $#screens )); then
_arguments -M 'r:|.=* r:|=*' : $opts \
- '1:systat(1) displays:(( ${pre}$^screens ))' \
+ '1:systat(1) display:(( ${pre}$^screens ))' \
'2:refresh interval'
return
fi
diff --git a/Completion/BSD/Command/_sysupgrade b/Completion/BSD/Command/_sysupgrade
new file mode 100644
index 000000000..b1144b0d5
--- /dev/null
+++ b/Completion/BSD/Command/_sysupgrade
@@ -0,0 +1,9 @@
+#compdef sysupgrade
+
+_arguments -s -S -A '-*' : \
+ '-f[force an already applied upgrade]' \
+ '-k[keep the downloaded files]' \
+ '-n[do not reboot]' \
+ '(-s)-r[upgrade to the next release]' \
+ '(-r)-s[upgrade to a snapshot]' \
+ ':installurl:'
diff --git a/Completion/BSD/Command/_usbconfig b/Completion/BSD/Command/_usbconfig
new file mode 100644
index 000000000..e7da8132c
--- /dev/null
+++ b/Completion/BSD/Command/_usbconfig
@@ -0,0 +1,63 @@
+#compdef usbconfig
+
+local curcontext="$curcontext" i ret=1
+local -a state line expl devices ids partial args
+
+_arguments -C \
+ '(-d)-u[limit device range to given USBUS unit]:bus:->buses' \
+ '(-d)-a[limit device range to given USB device index]:address:->addresses' \
+ '(-a -u)-d[limit device range to given unit and address]:device:->devices' \
+ '-i[specify interface index]:interface index' \
+ '(- 1)-h[display usage information]' \
+ '(-)1:command:compadd -M "r:|_=* r:|=*"
+ set_config set_alt set_template get_template add_dev_quirk_vplh
+ remove_dev_quirk_vplh add_quirk remove_quirk detach_kernel_driver
+ dump_quirk_names dump_device_quirks dump_all_desc dump_device_desc
+ dump_curr_config_desc dump_all_config_desc dump_string dump_info show_ifdrv
+ suspend resume power_off power_save power_on reset list do_request' \
+ '*::: := ->args' && ret=0
+
+case $state in
+ buses) partial=( ${(kv)=opt_args[(i)-a]:--a 1} ) i=1 ;|
+ addresses) partial=( ${(kv)opt_args[(i)-u]} ) i=2 ;&
+ buses)
+ devices=( ${${(f)"$(_call_program usb-devices usbconfig $partial list)"}:#No device*} )
+ ids=( ${${(MSI.i.)devices##[^0-9]<->}#?} )
+ _wanted usb-$state expl ${state%es} compadd -ld devices -o numeric -a ids && ret=0
+ ;;
+ devices)
+ devices=( ${${${(f)"$(_call_program usb-devices usbconfig list)"}/: /:}:#No device*} )
+ if (( $#devices )); then
+ _describe -t usb-devices device devices -M 'B:=ugen' && ret=0
+ else
+ _message -e usb-devices device
+ fi
+ ;;
+ args)
+ curcontext="${curcontext%:*}-$line[1]:"
+ case $line[1] in
+ set_config) args=( '1:cfg index' ) ;;
+ set_alt) args=( '1:alt index' ) ;;
+ set_template) args=( '1:template (see usb_template(4))' ) ;;
+ (add|remove)_dev_quirk_vplh) args=( -C
+ ':vendor id' ':product id' ':low revision'
+ ':high revision' ':quirk:->quirks'
+ ) ;;
+ (add|remove)_quirk) args=( -C '1:quirk:->quirks' ) ;;
+ dump_string) args=( '1:index' ) ;;
+ do_request) args=( :bmReqTyp :bReq :wVal :wIdx :wLen '*:data' ) ;;
+ esac
+ if (( $#args )); then
+ _arguments $args && ret=0
+ else
+ _message 'no more arguments'
+ fi
+ if [[ $state = quirks ]]; then
+ _wanted quirks expl quirk compadd \
+ -M 'm:{:lower:}={:upper:} r:|_=* r:|=* b:=UQ_' \
+ ${${(f)"$(_call_program quirks usbconfig dump_quirk_names)"}:#*list of*} && ret=0
+ fi
+ ;;
+esac
+
+return ret