summary refs log tree commit diff
path: root/Completion/BSD
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-07-17 12:37:29 +0200
committerOliver Kiddle <opk@zsh.org>2016-07-17 12:37:29 +0200
commit9991707b6bbdfe8940b2098128d85f61a966d758 (patch)
tree7e841073d3546ef999affafdda26fa210ea9a91f /Completion/BSD
parent52f46cca751cc40db978b88dd6379866cad30b15 (diff)
downloadzsh-9991707b6bbdfe8940b2098128d85f61a966d758.tar.gz
zsh-9991707b6bbdfe8940b2098128d85f61a966d758.tar.xz
zsh-9991707b6bbdfe8940b2098128d85f61a966d758.zip
38868: update completions for new options on FreeBSD
Diffstat (limited to 'Completion/BSD')
-rw-r--r--Completion/BSD/Command/_bsdconfig12
-rw-r--r--Completion/BSD/Command/_fetch69
-rw-r--r--Completion/BSD/Command/_freebsd-update11
-rw-r--r--Completion/BSD/Command/_fstat11
-rw-r--r--Completion/BSD/Command/_gstat6
-rw-r--r--Completion/BSD/Command/_jexec3
-rw-r--r--Completion/BSD/Command/_kld11
-rw-r--r--Completion/BSD/Command/_procstat37
-rw-r--r--Completion/BSD/Command/_sysrc53
-rw-r--r--Completion/BSD/Command/_systat3
10 files changed, 131 insertions, 85 deletions
diff --git a/Completion/BSD/Command/_bsdconfig b/Completion/BSD/Command/_bsdconfig
index 8c7597e0f..f88255575 100644
--- a/Completion/BSD/Command/_bsdconfig
+++ b/Completion/BSD/Command/_bsdconfig
@@ -2,6 +2,7 @@
 
 local -a shortcuts
 shortcuts=(
+  api
   'console:utilities to customize the behavior of the system console'
   'defaultrouter:default router/gateway'
   'diskmgmt:manage disk partitions and/or labels using sade(8)'
@@ -12,6 +13,7 @@ shortcuts=(
   'groupedit:edit/view groups'
   'groupmgmt:utilities to add/change/view/delete group accounts'
   'hostname:set hostname/domainname'
+  includes
   'kern_securelevel:set kern.securelevel variable'
   'mouse:utilities for configuring, exploring, and enabling console mouse support'
   'mouse_disable:disable mouse support'
@@ -43,13 +45,19 @@ shortcuts=(
   'userdel:delete users'
   'useredit:edit/view users'
   'usermgmt:utilities to add/edit/view/delete user accounts'
+  vt_font
+  vt_keymap
+  vt_repeat
+  vt_saver
+  vt_screenmap
+  vt_ttys
 )
 
 _arguments -s -w -A '-*' : \
   '-d[debug mode]' \
   '-D[send debug info to file]: :{ compset -P 1 +; _files }' \
   '-f[load file as script then exit]: : _files' \
-  '-h[print usage then exit]' \
+  '-h[display help information]' \
   '-S[secure X11 mode]' \
   '-X[use Xdialog(1)]' \
-  '1:bsdconfig(8) menus:(( $shortcuts ))'
+  '1:bsdconfig(8) menu:(( $shortcuts ))'
diff --git a/Completion/BSD/Command/_fetch b/Completion/BSD/Command/_fetch
index 3136763a0..ac1264bf8 100644
--- a/Completion/BSD/Command/_fetch
+++ b/Completion/BSD/Command/_fetch
@@ -1,30 +1,43 @@
 #compdef fetch
-# Deprecated arguments are removed from the completion
 
-_arguments -s \
-	'-1[stop and return exit code 0 at the first successfully retrieved file]' \
-	'-4[forces fetch to use IPv4 addresses only]' \
-	'-6[forces fetch to use IPv6 addresses only]' \
-	'-A[do not automatically follow "temporary" (302) redirects]' \
-	'-a[automatically retry the transfer upon soft failures]' \
-	'-B[specify the read buffer size in bytes]:bytes:' \
-	'-d[use a direct connection even if a proxy is configured]' \
-	'-F[in combination with the -r flag, forces a restart]' \
-	'-l[if the target is a file-scheme URL, make a symbolic link to the target]' \
-	'-M' \
-	'-m[mirror mode]' \
-	'-N[use file instead of ~/.netrc to look up login names and pass- words for FTP sites]' \
-	'-n[do not preserve the modification time]' \
-	'-o[set the output file name]:file:_files' \
-	'-P' \
-	'-p[use passive FTP]' \
-	'-q[quiet mode]' \
-	'-R[do not delete the output file in any circumstances]' \
-	'-r[restart a previously interrupted transfer]' \
-	'-S[require the file size reported by the server to match the specified value]' \
-	'-s[print the size in bytes, without fetching it]' \
-	'-T[set timeout value]:seconds:' \
-	'-U[when using passive FTP, allocate the port for the data connection from the low port range]' \
-	'-v[increase verbosity level]' \
-	'-w[wait successive retries]:seconds:' \
-	'*:URL to fetch:_urls'
+# Deprecated arguments are prefixed with ! so they aren't listed but their arguments are completed
+_arguments -s -S \
+  '(-1 --one-file)'{-1,--one-file}'[stop and return exit code 0 at the first successfully retrieved file]' \
+  '(-4 --ipv4-only)'{-4,--ipv4-only}'[forces fetch to use IPv4 addresses only]' \
+  '(-6 --ipv6-only)'{-6,--ipv6-only}'[forces fetch to use IPv6 addresses only]' \
+  '(-A --no-redirect)'{-A,--no-redirect}"[don't automatically follow "temporary" (302) redirects]" \
+  '(-a --retry)'{-a,--retry}'[automatically retry the transfer upon soft failures]' \
+  '(-B --buffer-size)'{-B+,--buffer-size=}'[specify the read buffer size in bytes]:buffer size (bytes)' \
+  '--bind-address=[specify address to which outgoing connections will be bound]:host:_hosts' \
+  '--ca-cert=[specify certificate bundle containing trusted CA certificates]:file:_files' \
+  '--ca-path=[specify directory containing trusted CA hashes]:path:_directories' \
+  '--cert=[specify PEM encoded client key for authentication]:file:_files -g "*.pem(-.)"' \
+  '--crl=[specify certificate revocation list file]:file:_files' \
+  '(-d --direct)'{-d,--direct}'[use a direct connection even if a proxy is configured]' \
+  '(-F --force-restart)'{-F,--force-restart}'[in combination with the -r flag, forces a restart]' \
+  '(-i --if-modified-since)'{-i+,--if-modified-since=}'[only retrieve if remote file newer than specified local file]:file:_files' \
+  '--key=[specify PEM encoded client key]:key file:_files -g "*.pem(-.)"' \
+  '(-l --symlink)'{-l,--symlink}'[if the target is a file-scheme URL, make a symbolic link to the target]' \
+  '-M' \
+  '(-m --mirror -r --restart)'{-m,--mirror}'[mirror mode]' \
+  '(-N --netrc)'{-N+,--netrc=}'[use file instead of ~/.netrc to look up login names and pass- words for FTP sites]' \
+  '(-n --no-mtime)'{-n,--no-mtime}"[don't preserve the modification time]" \
+  '--no-passive[force FTP code to use active mode]' \
+  '--no-proxy=[hosts on which to disable proxoes]:host:_sequence _hosts' \
+  '--no-sslv3' '--no-tlsv1' --no-verify-hostname --no-verify-peer \
+  '(-o --output)'{-o+,--output=}'[set the output file name]:file:_files' \
+  '-P' \
+  '(-p --passive)'{-p,--passive}'[use passive FTP]' \
+  '--referer=:URL:_urls' \
+  '(-q --quiet)'{-q,--quiet}'[quiet mode]' \
+  '(-R --keep-output)'{-R,--keep-output}"[don't delete the output file in any circumstances]" \
+  '(-r --restart -m --mirror)'{-r,--restart}'[restart a previously interrupted transfer]' \
+  '(-S --require-size)'{-S+,--require-size=}'[require the file size reported by the server to match the specified value]' \
+  '(-s --print-size)'{-s,--print-size}'[print the size in bytes, without fetching it]' \
+  '(-T --timeout)'{-T+,--timeout=}'[set timeout value]:seconds:' \
+  '(-U --passive-portrange-default)'{-U,--passive-portrange-default}'[when using passive FTP, allocate the port for the data connection from the low port range]' \
+  '--user-agent=:user agent' \
+  '(-v --verbose)'{-v,--verbose}'[increase verbosity level]' \
+  '(-w --retry-delay)'{-w+,--retry-delay=}'[wait successive retries]:delay (seconds)' \
+  '!(*)-h+:host:_hosts' '!(*)-f+:file:_files' '!(*)-c+:remote directory:_directories' \
+  '*:URL to fetch:_urls'
diff --git a/Completion/BSD/Command/_freebsd-update b/Completion/BSD/Command/_freebsd-update
index 11235bad0..36b4a015c 100644
--- a/Completion/BSD/Command/_freebsd-update
+++ b/Completion/BSD/Command/_freebsd-update
@@ -7,14 +7,17 @@ flags=(
   '(install rollback)upgrade[fetch files necessary for upgrading to a new release]'
   '(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]'
 )
 
-_arguments -s \
+_arguments \
   '-b[operate on a system mounted at basedir]:basedir:_files -/' \
   '-d[store working files in workdir]:workdir:_files -/' \
   '-f[read configuration options from conffile]:conf file:_files' \
-  '-k[trust an RSA key with SHA256 of KEY]:RSA key:' \
-  '-r[specify the new release]:new release:' \
+  '-F[force freebsd-update fetch to proceed where it normally would not]' \
+  '-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' \
-  '-f[mail output of cron command, if any, to address]:address:' \
+  '-t[mail output of cron command, if any, to address]:address' \
+  '--currently-running[assume specified release as current]:release' \
   ':command:_values -S " " -w "commands" $flags[@]'
diff --git a/Completion/BSD/Command/_fstat b/Completion/BSD/Command/_fstat
index 3e8d61733..5487e6c0f 100644
--- a/Completion/BSD/Command/_fstat
+++ b/Completion/BSD/Command/_fstat
@@ -1,15 +1,12 @@
 #compdef fstat
 
-local pids
-pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})
-
 _arguments -s \
 '-f[restrict examination to files open in the same file systems as the named file arguments]' \
-'-M[extract values associated with the name list from the specified core]:core:_files' \
-'-N[extract the name list from the specified system]:system:' \
+'-M+[extract values associated with the name list from the specified core]:core:_files' \
+'-N+[extract the name list from the specified system]:system' \
 '-m[include memory-mapped files in the listing]' \
 '-n[numerical format]' \
-'-p[report all files open by the specified process]:process id:(($pids))' \
-'-u[report all files open by the specified user]:user:_users' \
+'-p+[report all files open by the specified process]:process id:_pids' \
+'-u+[report all files open by the specified user]:user:_users' \
 '-v[verbose mode]' \
 '*:files:_files'
diff --git a/Completion/BSD/Command/_gstat b/Completion/BSD/Command/_gstat
index 55b7db74d..7baaf0d62 100644
--- a/Completion/BSD/Command/_gstat
+++ b/Completion/BSD/Command/_gstat
@@ -1,11 +1,11 @@
 #compdef gstat
 
-_arguments -s -w : \
+_arguments -s : \
   '-a[only display providers that are at least 0.1% busy]' \
   '-b[batch mode]' \
   '-c[enable the display geom(4) consumers]' \
   '-d[enable the display delete operations]' \
-  '-f[filter by regex]:regex' \
+  '-f+[filter by regex]:regex' \
   '-o[enable the display for other operations]' \
-  '-I[display refresh rate]:interval' \
+  '-I+[display refresh rate]:interval (ms)' \
   '-p[only display physical providers]'
diff --git a/Completion/BSD/Command/_jexec b/Completion/BSD/Command/_jexec
index f065ea1e0..279812bbc 100644
--- a/Completion/BSD/Command/_jexec
+++ b/Completion/BSD/Command/_jexec
@@ -9,7 +9,8 @@ _jexec_normal() {
 }
 
 _jexec() {
-  _arguments -s -w -A "-*" : \
+  _arguments -s -S -A "-*" : \
+    '-l[execute in a clean environment]' \
     '(-U)-u[host environment user whom command runs as]:host user:_users' \
     '(-u)-U[jail environment user whom command runs as]:jail user:_users' \
     '1:jail:_jails' \
diff --git a/Completion/BSD/Command/_kld b/Completion/BSD/Command/_kld
index 34f26f1e9..94528955c 100644
--- a/Completion/BSD/Command/_kld
+++ b/Completion/BSD/Command/_kld
@@ -24,14 +24,17 @@ _kld() {
   unset _cache_sysctlvars
 
   case "$service" in
-  kldload)
-    _arguments -s \
+    kldload)
+      _arguments -s -S -A "-*" \
+        "-n[don't try to load module if already loaded]"
         '-v[be verbose]' \
+        '-q[silence any extraneous warnings]' \
         '*:module to load:_kld_module'
     ;;
 
-  kldunload)
-    _arguments -s \
+    kldunload)
+      _arguments -s -S -A "-*" \
+        '-f[force the unload]' \
         '-v[be verbose]' \
         '(-n)-i:module id to unload:_kld_unload_id' \
         '(-i)-n:module to unload:_kld_unload' \
diff --git a/Completion/BSD/Command/_procstat b/Completion/BSD/Command/_procstat
index f8bc54290..e16057635 100644
--- a/Completion/BSD/Command/_procstat
+++ b/Completion/BSD/Command/_procstat
@@ -1,17 +1,24 @@
 #compdef procstat
 
-local pids
-#get list of pids and associated process name as comment
-pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})
-
-_arguments -s \
-'-b[display binary information for the process]' \
-'-c[display command line arguments for the process]' \
-'-f[display file descriptor information for the process]' \
-'-k[display the stacks of kernel threads in the process]' \
-'-s[display security credential information for the process]' \
-'-t[display thread information for the process]' \
-'-v[display virtual memory mappings for the process]' \
-'-h[suppress table headers]' \
-'-a[all processes]' \
-':process id:(($pids))'
+_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]' \
+  '-k[show stacks of kernel threads]' \
+  '-l[show resource limits]' \
+  '-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]' \
+  '-h[suppress table headers]' \
+  '(1)-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*(-.)"' \
+  '*:process id:_pids'
diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc
index d8bc4ef0e..651c18b89 100644
--- a/Completion/BSD/Command/_sysrc
+++ b/Completion/BSD/Command/_sysrc
@@ -1,39 +1,50 @@
 #compdef sysrc
+
 _sysrc_caching_policy() {
   local -a oldp
   oldp=( "$1"(Nm+1) )
   (( $#oldp ))
 }
 
-
 _sysrc() {
-  _arguments -A '-*' : \
+  local curcontext="$curcontext" state line ret=1
+  typeset -A opt_args
+  local -a rc_conf_vars
+
+  _arguments -C -s -A '-*' : \
+    '(-l)-e[print variables as sh(1) compatible syntax]' \
+    '-E[list only existing files]' \
+    '(-l)-q[quiet mode]' \
+    '(-L)-s+[process additional rc.conf.d entries for specified service name]:service name:_services' \
+    '(-L)*-f+[operate on specified file(s), not \`rc_conf_files'\'']: : _files' \
+    '(-l)-v[verbose mode]' \
+    '*:configuration variable:->confvars' \
+    - set \
+    '(-A)-a[list all non-default configuration variables]' \
+    '(-a)-A[list all configuration variables]' \
     '-c[check only, return success if vars are set]' \
     '-d[print variable(s) description]' \
     '-D[print default value(s) only]' \
-    '-e[print variables as sh(1) compatible syntax]' \
-    '*-f[operate on specified file(s), not \`rc_conf_files'\'']: : _files' \
     '-F[print only the last rc.conf(5) file each directive is in]' \
-    '-h[print short usage message]' \
-    '--help[print full usage message]' \
+    '(- *)-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]:jails:_jails' \
     '-n[print only variable values]' \
     '-N[print only variable names]' \
-    '-q[quiet mode]' \
-    '-R[specify an alternative root]:alternative root:_files -/' \
-    '-v[verbose mode]' \
-    '--version[print version information]' \
+    '-R+[specify an alternative root]:alternative root:_files -/' \
+    '(- *)--version[print version information]' \
     '-x[remove specified variables from specified file(s)]' \
-    '*:configuration variable:->confvars' \
-    - set1 \
-    '-a[list all non-default configuration variables]' \
-    - set2 \
-    '-A[list all configuration variables]'
+    - lists \
+    '(-e -q -v)-l[list config files used at startup]' \
+    - lista \
+    '(-s -f)-L[list all configuration files including rc.conf.d entries]' && ret=0
 
   if [[ $state  == confvars ]]; then
-    local k v opt curcontext="${curcontext%:*}:values"; local -a rc_conf_vars
-    if [[ -prefix *=* ]]; then
+    local k v opt
+    if (( $+opt_args[lista--L] )); then
+      _services && ret=0
+    elif [[ -prefix *=* ]]; then
       # do you really want to go down this hole?
       _message -e values value
     else
@@ -65,13 +76,15 @@ _sysrc() {
 
       if (( $#rc_conf_vars )); then
         if [[ $opt == N ]]; then
-          _values -w -C variable ${^rc_conf_vars%%\[*}'::value'
+          _values -w -C variable ${^rc_conf_vars%%\[*}'::value' && ret=0
         else
-          _values -w -C variable ${^rc_conf_vars}'::value'
+          _values -w -C variable ${^rc_conf_vars}'::value' && ret=0
         fi
       fi
     fi
   fi
+
+  return ret
 }
 
 _sysrc "$@"
diff --git a/Completion/BSD/Command/_systat b/Completion/BSD/Command/_systat
index c8348c7f7..35b842188 100644
--- a/Completion/BSD/Command/_systat
+++ b/Completion/BSD/Command/_systat
@@ -1,12 +1,13 @@
 #compdef systat
 
-local -a screens args opts
+local -a screens opts
 local pre
 case $OSTYPE in
   freebsd*)
     pre=-
     screens=(
       'pigs:processes consuming the most CPU time'
+      'sctp:SCTP statistics'
       icmp{6,}':ICMP statistics'
       ip{6,}':IP and UDP statistics'
       'tcp:TCP statistics'