summaryrefslogtreecommitdiff
path: root/Completion/BSD
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/BSD')
-rw-r--r--Completion/BSD/Command/_acpiconf28
-rw-r--r--Completion/BSD/Command/_bsdconfig1
-rw-r--r--Completion/BSD/Command/_chflags25
-rw-r--r--Completion/BSD/Command/_freebsd-update1
-rw-r--r--Completion/BSD/Command/_fw_update6
-rw-r--r--Completion/BSD/Command/_ipfw137
-rw-r--r--Completion/BSD/Command/_jexec2
-rw-r--r--Completion/BSD/Command/_ldap4
-rw-r--r--Completion/BSD/Command/_pfctl5
-rw-r--r--Completion/BSD/Command/_pkgin2
-rw-r--r--Completion/BSD/Command/_procstat35
-rw-r--r--Completion/BSD/Command/_rcctl4
-rw-r--r--Completion/BSD/Command/_sockstat13
-rw-r--r--Completion/BSD/Command/_systat1
14 files changed, 172 insertions, 92 deletions
diff --git a/Completion/BSD/Command/_acpiconf b/Completion/BSD/Command/_acpiconf
new file mode 100644
index 000000000..817a2f1ad
--- /dev/null
+++ b/Completion/BSD/Command/_acpiconf
@@ -0,0 +1,28 @@
+#compdef acpiconf
+
+local curcontext="$curcontext" sep ret=1
+local -a state line modes desc
+local -A opt_args
+
+_arguments -s \
+ '(-)-h[display usage information]' \
+ '(-)-i[get battery information]:battery' \
+ '(-)-k[ack or abort a pending suspend]:ack' \
+ '(-)-s[enter specified sleep mode]: :->modes' && ret=0
+
+if [[ -n $state ]]; then
+ modes=( $(_call_program modes sysctl -n hw.acpi.supported_sleep_state) )
+ zstyle -s ":completion:${curcontext}:modes" list-separator sep || sep=--
+ (( $#modes )) || modes=( S3 S4 )
+ desc=(
+ "S1 $sep stop the processor clock"
+ "S2 $sep low wake latency sleep state"
+ "S3 $sep suspend to RAM"
+ "S4 $sep suspend to disk"
+ "S5 $sep soft off state"
+ )
+ desc=( ${(M)desc:#(${(~j.|.)modes}) *} )
+ _wanted modes expl 'mode' compadd -M 'B:S=' -ld desc - ${modes#S} && ret=0
+fi
+
+return ret
diff --git a/Completion/BSD/Command/_bsdconfig b/Completion/BSD/Command/_bsdconfig
index f88255575..5de8f777d 100644
--- a/Completion/BSD/Command/_bsdconfig
+++ b/Completion/BSD/Command/_bsdconfig
@@ -51,6 +51,7 @@ shortcuts=(
vt_saver
vt_screenmap
vt_ttys
+ wifi wireless wlan
)
_arguments -s -w -A '-*' : \
diff --git a/Completion/BSD/Command/_chflags b/Completion/BSD/Command/_chflags
index 924b09acd..905aa0645 100644
--- a/Completion/BSD/Command/_chflags
+++ b/Completion/BSD/Command/_chflags
@@ -1,22 +1,31 @@
#compdef chflags
-local args own='-g *(-u$EUID)'
+local own='-g *(-u$EUID)'
+local -a args recurse
(( ! EUID || $+_comp_priv_prefix )) && own=
-if [[ $OSTYPE = (darwin|dragonfly|freebsd)* ]]; then
- args=(
- "-f[don't display diagnostic messages]"
- '-v[verbose output]'
- )
-fi
+case $OSTYPE in
+ (darwin|dragonfly|freebsd)*)
+ args=(
+ "-f[don't display diagnostic messages]"
+ '-v[verbose output]'
+ )
+ ;|
+ darwin*|freebsd*)
+ recurse=( "-x[don't cross mount points]" )
+ ;|
+ netbsd*)
+ args=( '-d[if the change requested would not alter the flags, attempt no change]' )
+ ;|
+esac
_arguments -s -A "-*" : $args \
': :_file_flags' \
'*:file:_files "$own"' \
- opth \
'-h[act on symlinks]' \
- - optR \
+ - optR $recurse \
'-R[recurse directories]' \
'(-L -P)-H[follow symlinks on the command line (specify with -R)]' \
'(-H -P)-L[follow all symlinks (specify with -R)]' \
diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update
index 7dd907298..af37641e4 100644
--- a/Completion/BSD/Command/_freebsd-update
+++ b/Completion/BSD/Command/_freebsd-update
@@ -17,6 +17,7 @@ _arguments \
'-d[store working files in workdir]:workdir:_files -/' \
'-f[read configuration options from conffile]:conf file:_files' \
'-F[force freebsd-update fetch to proceed where it normally would not]' \
+ '-j[operate on specified jail]: :_jails' \
'-k[trust an RSA key with SHA256 of KEY]:RSA key' \
'-r[specify the new release]:new release' \
'-s[fetch files from the specified server or server pool]:server:_hosts' \
diff --git a/Completion/BSD/Command/_fw_update b/Completion/BSD/Command/_fw_update
index b01749f3f..84b5f808d 100644
--- a/Completion/BSD/Command/_fw_update
+++ b/Completion/BSD/Command/_fw_update
@@ -3,8 +3,10 @@
_arguments -s -S -A "-*" \
'(*)-a[install or update firmware for all drivers]' \
'-d[delete drivers instead of adding them]' \
- '-i[display information]' \
+ '-F[download firmware only]' \
'-n[dry run]' \
- '-p[use the firmware at specified path]:path:' \
+ '-p+[use the firmware at specified path]: : _alternative
+ "urls\:url\:_urls"
+ "directories\:path\:_directories"' \
'*-v[verbose output]' \
'(-a)*:driver:'
diff --git a/Completion/BSD/Command/_ipfw b/Completion/BSD/Command/_ipfw
index 49d0ef1e8..b910aa34d 100644
--- a/Completion/BSD/Command/_ipfw
+++ b/Completion/BSD/Command/_ipfw
@@ -1,7 +1,7 @@
-#compdef ipfw
+#compdef ipfw dnctl
local word=$'/[^ \t\0]#[ \t\0]/' comma next pqs nat
-local -a actions address pathname ropts ca
+local -a actions address dummynet args ropts ca
local -A opt_args nat_options
_ipfw_tables() {
@@ -80,6 +80,46 @@ address=(
\| \)
)
+dummynet=(
+ $'/(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'
+ \) \#
+)
+
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
@@ -241,48 +281,14 @@ actions=(
\| $'/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'
+ \| $'/port_range[ \t\0]/'
+ '/[0-9]#-/' ': _message -e ports lower'
+ $word ': _message -e ports upper'
+ \| $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 port_range'
\) \#
\| $'/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'
- \) \#
+ \| $dummynet
\| # 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)'
@@ -292,11 +298,36 @@ actions=(
\)
)
-if (( $words[(I)-p*] )); then
- pathname=( ':path:_files -P / -W /' )
-fi
+case $service in
+ ipfw)
+ _regex_arguments _ipfw_actions "$actions[@]"
+ args=(
+ '!-e' # nop for compatibility
+ '(-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]'
+ '(-p)-i[format values as IP addresses in table listings]'
+ '-N[resolve addresses and service names in output]'
+ '-q[quiet output]'
+ '-S[show the set each rule belongs to]'
+ '(-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'
+ )
+ if (( $words[(I)-p*] )); then
+ args+=( ':path:_files -P / -W /' )
+ fi
+ ;;
+ dnctl)
+ _regex_arguments _ipfw_actions \
+ $'/[^\0]##\0(-[a-zA-Z0-9]##[ \t]#)#/' \
+ "$dummynet[@]"
+ ;;
+esac
-_regex_arguments _ipfw_actions "$actions[@]"
if [[ -prefix *[$' \t']* ]]; then
# This allows from things like ipfw "-n add..."
@@ -304,22 +335,10 @@ if [[ -prefix *[$' \t']* ]]; then
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]' \
+_arguments -s $args \
'(- *)-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' \
+ '-v[verbose]' \
'*:::actions:= _ipfw_actions'
diff --git a/Completion/BSD/Command/_jexec b/Completion/BSD/Command/_jexec
index 6a2d05a81..cd99ebe91 100644
--- a/Completion/BSD/Command/_jexec
+++ b/Completion/BSD/Command/_jexec
@@ -6,7 +6,7 @@ _jexec_normal() {
# relative paths are relative to the jail's root
path=( "$(_call_program paths jls -j $words[1] path)"/$^path )
shift 1 words; (( CURRENT-- ))
- _normal
+ _normal -p $service
}
_jexec() {
diff --git a/Completion/BSD/Command/_ldap b/Completion/BSD/Command/_ldap
index 8fa17e2f8..181e6b0d0 100644
--- a/Completion/BSD/Command/_ldap
+++ b/Completion/BSD/Command/_ldap
@@ -80,8 +80,8 @@ else
'-x[use simple authentication]' \
'-Z[use StartTLS]' \
'-z+[specify maximum number of results or 0 for no limit]:size limit [0]:' \
- '::filter:' \
- '*:attribute:'
+ '1: :_ldap_filters' \
+ '*: :_ldap_attributes'
;;
esac
fi
diff --git a/Completion/BSD/Command/_pfctl b/Completion/BSD/Command/_pfctl
index 812e52bdb..8063eb504 100644
--- a/Completion/BSD/Command/_pfctl
+++ b/Completion/BSD/Command/_pfctl
@@ -91,7 +91,10 @@ case $OSTYPE in
)
;|
freebsd*)
- args+=( '-P[display ports numerically]' )
+ args+=(
+ '-M[kill matching states in the opposite direction]'
+ '-P[display ports numerically]'
+ )
;;
esac
diff --git a/Completion/BSD/Command/_pkgin b/Completion/BSD/Command/_pkgin
index 662bed181..c4ed3aa14 100644
--- a/Completion/BSD/Command/_pkgin
+++ b/Completion/BSD/Command/_pkgin
@@ -5,6 +5,8 @@ local -a state state_descr line expl cmds short pkgs
local -A opt_args
_arguments -s -S -C \
+ '(-6)-4[only use IPv4 addresses]' \
+ '(-4)-6[only use IPv6 addresses]' \
'-c+[enable chrooting pkgin in the given repository]:chroot path:_directories' \
'-d[download only]' \
'-f[force database update]' \
diff --git a/Completion/BSD/Command/_procstat b/Completion/BSD/Command/_procstat
index a1708f6ac..867ddc501 100644
--- a/Completion/BSD/Command/_procstat
+++ b/Completion/BSD/Command/_procstat
@@ -1,26 +1,27 @@
#compdef procstat
_arguments -s -A "-*" -S \
- '-b[show binary information]' \
- '-c[show command line arguments]' \
- '-e[show environment variables]' \
- '-f[show file descriptor information]' \
- '-i[show signal pending and disposition]' \
- '-j[show signal pending and blocked information for process threads]' \
- '-k[show stacks of kernel threads]' \
- '-l[show resource limits]' \
- "-L[show LWP info for the process pertaining to it's signal driven exit]" \
- '-r[show resource usage]' \
- '-s[show security credential information]' \
- '-S[show cpuset information]' \
- '-t[show thread information]' \
- '-v[show virtual memory mappings]' \
- '-x[show ELF auxiliary vector]' \
+ '(1)-b[show binary information]' \
+ '(1)-c[show command line arguments]' \
+ '(1)-e[show environment variables]' \
+ '(1)-f[show file descriptor information]' \
+ '(1)-i[show signal pending and disposition]' \
+ '(1)-j[show signal pending and blocked information for process threads]' \
+ '(1)-k[show stacks of kernel threads]' \
+ '(1)-l[show resource limits]' \
+ "(1)-L[show LWP info for the process pertaining to it's signal driven exit]" \
+ '(1)-r[show resource usage]' \
+ '(1)-s[show security credential information]' \
+ '(1)-S[show cpuset information]' \
+ '(1)-t[show thread information]' \
+ '(1)-v[show virtual memory mappings]' \
+ '(1)-x[show ELF auxiliary vector]' \
'-h[suppress table headers]' \
- '(1)-a[all processes]' \
+ '(2 *)-a[all processes]' \
'-w+[repeat information after specified interval]:delay (seconds)' \
'-C[print additional capability information for file descriptors]' \
'-H[statistics per-thread rather than per-process]' \
'-n[numeric form for signals]' \
- '1::core file:_path_files -g "*core*(-.)"' \
+ '1::command:(advlock argument auxv basic binary cpuset credential environment fd file kstack pargs ptlwpinfo pwdx rlimit rlimitusage rusage sigfastblock signal thread tsignal vm)' \
+ '2::core file:_path_files -g "*core*(-.)"' \
'*:process id:_pids'
diff --git a/Completion/BSD/Command/_rcctl b/Completion/BSD/Command/_rcctl
index 6cfebf420..457c3eb85 100644
--- a/Completion/BSD/Command/_rcctl
+++ b/Completion/BSD/Command/_rcctl
@@ -3,7 +3,7 @@
local context state line
local -a actions lsarg subcmds variables
-actions=(check reload restart start stop)
+actions=(configtest check reload restart start stop)
subcmds=(disable enable get getdef ls order set)
variables=(class flags status timeout user)
lsarg=(
@@ -46,6 +46,6 @@ case $service in
'*:argument:'
;;
${(~j:|:)actions}|disable|enable)
- _arguments "*:service to $words[2]:_services"
+ _arguments "*:service to ${words[2]}:_services"
;;
esac
diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat
index 1d7973db7..b99d3681a 100644
--- a/Completion/BSD/Command/_sockstat
+++ b/Completion/BSD/Command/_sockstat
@@ -21,6 +21,19 @@ case $OSTYPE in
'-w[use wider field size for displaying addresses]'
)
;|
+ freebsd<13->.*)
+ args+=(
+ '-C[display the congestion control module]'
+ '-i[display the inp_gencnt]'
+ "-n[don't resolve numeric UIDs to user names]"
+ '-q[quiet mode, do not print the header line]'
+ )
+ ;|
+ freebsd<14->.*)
+ args+=(
+ '-I[show local address of socket to which the current socket is spliced]'
+ )
+ ;|
freebsd*)
for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do
case $proto in
diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat
index 03df07631..fcb5565d7 100644
--- a/Completion/BSD/Command/_systat
+++ b/Completion/BSD/Command/_systat
@@ -79,6 +79,7 @@ case $OSTYPE in
"-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"
+ '-z[display 0 instead of space when there is no data]'
)
esac