about summary refs log tree commit diff
path: root/Completion/BSD
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/BSD')
-rw-r--r--Completion/BSD/Command/_bsd_pkg47
-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/_pfctl7
-rw-r--r--Completion/BSD/Command/_rcctl6
-rw-r--r--Completion/BSD/Command/_sockstat8
-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/_sysupgrade9
-rw-r--r--Completion/BSD/Type/_login_classes9
-rw-r--r--Completion/BSD/Type/_routing_domains6
-rw-r--r--Completion/BSD/Type/_routing_tables6
17 files changed, 193 insertions, 99 deletions
diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg
index 6bdce58e0..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,26 +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"
@@ -190,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]'
@@ -210,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]'
@@ -228,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/_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 23898882f..8063eb504 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*)
@@ -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/_rcctl b/Completion/BSD/Command/_rcctl
index 44ba0f28b..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=(
@@ -36,7 +36,7 @@ case $service in
     ;;
   order)
     _arguments \
-      ':service to start first:_services'
+      ':service to start first:_services' \
       '*:service to start next:_services'
     ;;
   set)
@@ -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..f372fe1b3 100644
--- a/Completion/BSD/Command/_sockstat
+++ b/Completion/BSD/Command/_sockstat
@@ -21,6 +21,14 @@ 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*)
     for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do
       case $proto in
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/_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/Type/_login_classes b/Completion/BSD/Type/_login_classes
index 227e3c748..a2e6983a9 100644
--- a/Completion/BSD/Type/_login_classes
+++ b/Completion/BSD/Type/_login_classes
@@ -1,4 +1,11 @@
 #autoload
 
+local expl login_classes
+
+login_classes=(${${(M)${(f)"$(</etc/login.conf)"}:#[^#[:blank:]]*}%%[:|]*})
+if [[ $OSTYPE = openbsd* ]]; then
+  login_classes+=(/etc/login.conf.d/*(N:t))
+fi
+
 _description login-classes expl 'login class'
-compadd "$@" "$expl[@]" - ${${(M)${(f)"$(</etc/login.conf)"}:#[^#[:blank:]]*}%%[:|]*}
+compadd "$@" "$expl[@]" - $login_classes
diff --git a/Completion/BSD/Type/_routing_domains b/Completion/BSD/Type/_routing_domains
new file mode 100644
index 000000000..4bb9f78b0
--- /dev/null
+++ b/Completion/BSD/Type/_routing_domains
@@ -0,0 +1,6 @@
+#autoload
+
+local expl
+
+_description routing-domains expl 'routing domain'
+compadd "$@" "$expl[@]" -  ${${(M)${(f)"$(_call_program routing-domains netstat -R)"}:#Rdomain *}#Rdomain }
diff --git a/Completion/BSD/Type/_routing_tables b/Completion/BSD/Type/_routing_tables
new file mode 100644
index 000000000..3ba1931fe
--- /dev/null
+++ b/Completion/BSD/Type/_routing_tables
@@ -0,0 +1,6 @@
+#autoload
+
+local expl
+
+_description routing-tables expl 'routing table'
+compadd "$@" "$expl[@]" -  ${(s: :)${${(M)${(f)"$(_call_program routing-tables netstat -R)"}:#  Routing tables#: *}#*: }}