diff options
Diffstat (limited to 'Completion/BSD')
-rw-r--r-- | Completion/BSD/Command/_bsdconfig | 12 | ||||
-rw-r--r-- | Completion/BSD/Command/_chflags | 96 | ||||
-rw-r--r-- | Completion/BSD/Command/_cu | 2 | ||||
-rw-r--r-- | Completion/BSD/Command/_fetch | 69 | ||||
-rw-r--r-- | Completion/BSD/Command/_freebsd-update | 13 | ||||
-rw-r--r-- | Completion/BSD/Command/_fstat | 11 | ||||
-rw-r--r-- | Completion/BSD/Command/_gstat | 6 | ||||
-rw-r--r-- | Completion/BSD/Command/_jexec | 4 | ||||
-rw-r--r-- | Completion/BSD/Command/_jot | 82 | ||||
-rw-r--r-- | Completion/BSD/Command/_kld | 11 | ||||
-rw-r--r-- | Completion/BSD/Command/_portmaster | 2 | ||||
-rw-r--r-- | Completion/BSD/Command/_procstat | 37 | ||||
-rw-r--r-- | Completion/BSD/Command/_sockstat | 1 | ||||
-rw-r--r-- | Completion/BSD/Command/_sysrc | 53 | ||||
-rw-r--r-- | Completion/BSD/Command/_systat | 3 |
15 files changed, 282 insertions, 120 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/_chflags b/Completion/BSD/Command/_chflags index c9f26249d..075782cd9 100644 --- a/Completion/BSD/Command/_chflags +++ b/Completion/BSD/Command/_chflags @@ -1,47 +1,79 @@ #compdef chflags -local flags own='-g *(-u$EUID)' - -flags=( - '(noopaque)opaque[set the opaque flag]' - '(opaque)noopaque[unset the opaque flag]' - '(dump)nodump[set the nodump flag]' - '(nodump)dump[unset the nodump flag]' - '(nouappnd)uappnd[set the user append-only flag]' - '(uappnd)nouappnd[unset the user append-only flag]' - '(nouchg)uchg[set the user immutable flag]' - '(uchg)nouchg[unset the user immutable flag]' -) +local flags args own='-g *(-u$EUID)' + +addflags() { + for 1 2; do + if [[ $1 = no* ]]; then + flags+=("(${1#no})$1[set the $2 flag]" + "($1)${1#no}[unset the $2 flag]") + else + flags+=("(no$1)$1[set the $2 flag]" + "($1)no$1[unset the $2 flag]") + fi + done +} + +addflags \ + uappnd 'user append-only' \ + uchg 'user immutable' if (( ! EUID )); then - flags=( $flags[@] - '(noarch)arch[set the archived flag]' - '(arch)noarch[unset the archived flag]' - '(nosappnd)sappnd[set the system append-only flag]' - '(sappnd)nosappnd[unset the system append-only flag]' - '(noschg)schg[set the system immutable flag]' - '(schg)noschg[unset the system immutable flag]' - ) + addflags \ + arch archived \ + nodump nodump \ + sappnd 'system append-only' \ + schg 'system immutable' unset own fi -if [[ $OSTYPE = (freebsd|dragonfly|darwin)* ]]; then - flags=( $flags[@] - '(nouunlnk)uunlnk[set the user undeletable flag]' - '(uunlnk)nouunlnk[unset the user undeletable flag]' - '(nohidden)hidden[set the hidden flag]' - '(hidden)nohidden[unset the hidden flag]' - ) - (( EUID )) || flags=( $flags[@] - '(nosunlnk)sunlnk[set the system undeletable flag]' - '(sunlnk)nosunlnk[unset the system undeletable flag]' +if [[ $OSTYPE = (darwin|dragonfly|freebsd|netbsd)* ]]; then + addflags opaque opaque + + if [[ $OSTYPE = darwin* ]]; then + addflags hidden hidden + fi + + if [[ $OSTYPE = (dragonfly|freebsd)* ]]; then + addflags uunlnk 'user undeletable' + (( EUID )) || addflags sunlnk 'system undeletable' + fi + + [[ $OSTYPE = dragonflybsd* ]] && { + addflags \ + cache XXX \ + nouhistory 'user nohistory' + + (( EUID )) || addflags \ + noscache XXX \ + noshistory 'system nohistory' + } + + [[ $OSTYPE = freebsd* ]] && addflags \ + uarch archive \ + uhidden hidden \ + uoffline offline \ + urdonly 'DOS, Windows and CIFS readonly' \ + ureparse 'Windows reparse point' \ + usparse 'sparse file' \ + usystem 'DOS, Windows and CIFS system' + +fi + +if [[ $OSTYPE = (darwin|dragonfly|freebsd)* ]]; then + args=( + "-f[don't display diagnostic messages]" + '-v[verbose output]' ) fi -_arguments -s -A "-*" \ +_arguments -s -A "-*" : $args \ + - opth \ + '-h[act on symlinks]' \ + - optR \ + '-R[recurse directories]' \ '(-L -P)-H[follow symlinks on the command line (specify with -R)]' \ '(-H -P)-L[follow all symlinks (specify with -R)]' \ '(-L -H)-P[do not follow symlinks (specify with -R)]' \ - '-R[recurse directories]' \ ':file flag:_values -s , "file flags" $flags[@]' \ '*:file:_files "$own"' diff --git a/Completion/BSD/Command/_cu b/Completion/BSD/Command/_cu index 4b9f25d1f..8c0d1efef 100644 --- a/Completion/BSD/Command/_cu +++ b/Completion/BSD/Command/_cu @@ -3,5 +3,5 @@ _arguments -s -A '-*' \ '-d[do not block waiting for a carrier to be detected]' \ '-l[line to use]:line:(/dev/(cuaU#<->|ttyS<->)(N%c))' \ - '-s[line speed]:line speed:_baudrate -d "line speed"' \ + '-s[line speed]:line speed:_baudrates' \ '(-*)1:host:' 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..d42457272 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:' \ - ':command:_values -S " " -w "commands" $flags[@]' + '-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..85829d10e 100644 --- a/Completion/BSD/Command/_jexec +++ b/Completion/BSD/Command/_jexec @@ -2,6 +2,7 @@ _jexec_normal() { local PATH=$PATH + local -a _comp_priv_prefix # relative paths are relative to the jail's root path=( "$(command jls -j $words[1] path)"/$^path ) shift 1 words; (( CURRENT-- )) @@ -9,7 +10,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/_jot b/Completion/BSD/Command/_jot new file mode 100644 index 000000000..e8abcb7d1 --- /dev/null +++ b/Completion/BSD/Command/_jot @@ -0,0 +1,82 @@ +#compdef jot + +local curcontext="$curcontext" state state_descr line ret=1 +local -A opt_args + +_arguments -s -C : \ + '(-b)-r[generate random data instead of the default sequential data]' \ + '(-c -p -r -w)-b+[just print the specified word repeatedly]:word:' \ + '(-b -c -p)-w+[specify output format as in printf]:output format:->format' \ + '(-b -p -w)-c[same as -w %c]' \ + '-s+[separate the data by the specified string instead of newline]:string:' \ + '-n[do not print the final newline]' \ + '(-b -c -w)-p+[specify number of digits after decimal point]:precision:' \ + '(-)1: :_guard "^-*" "number of data"' \ + '2::lower bound:' \ + '3::upper bound:' \ + '4:: :->lastarg' && ret=0 + +case $state in + (format) + local -a flags digits conversions + flags=( + '#:alternative form' + ' :leave a blank before a positive number' + '+:always place a sign before a number' + '-:left adjust' + ) + digits=(0 1 2 3 4 5 6 7 8 9 .) + conversions=( + {d,i}':signed decimal' + 'o:unsigned octal' + 'u:unsigned decimal' + {x,X}':unsigned hexadecimal' + 'l'{d,i}':long signed decimal' + 'lo:long unsigned octal' + 'lu:long unsigned decimal' + 'l'{x,X}':long unsigned hexadecimal' + 'f:double number' + {e,E}':double number in scientific notation' + {g,G}':use %f or %e, whichever is more appropriate' + 'c:character' + ) + + compset -P '([^%]#%%)#' + if compset -P '[^%]#%'; then + # flags: (|\#)(| )(|+|-) + compset -P '(\#|\\\#)' && flags=( ${(@)flags:#\#*} ) + compset -P '( |\\ )' && flags=( ${(@)flags:#(\#| )*} ) + compset -P '(+|-)' || compset -P '[0-9]##' && flags=() + # width.precision: [0-9]#(|.[0-9]#) + if compset -P '.'; then + flags=() + digits=( ${(@)digits:#.} ) + fi + compset -P '[0-9]#' + # conversion specifier: ((|l)[diouxX]|[feEgGc]) + if compset -P '((|l)[diouxX]|[feEgGc])'; then + _message -e format-rest 'rest of the format' && ret=0 + else + local opts=( -S '' ) + _alternative -O opts 'flags:flag:(( $flags ))' \ + "width-precision:width.precision:($digits)" \ + 'conversion-specifiers:conversion specifier:(( $conversions ))' \ + && ret=0 + fi + else + local expl + compset -P '*' + _wanted start-specification expl 'start specification' \ + compadd -S '' % && ret=0 + fi + ;; + (lastarg) + if (( $+opt_args[-r] )); then + _message -e seeds 'random number seed' && ret=0 + else + _message -e steps 'step size' && ret=0 + fi + ;; +esac + +return ret diff --git a/Completion/BSD/Command/_kld b/Completion/BSD/Command/_kld index 34f26f1e9..42fdc2bd0 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/_portmaster b/Completion/BSD/Command/_portmaster index 4c16e2d1b..48390c9ad 100644 --- a/Completion/BSD/Command/_portmaster +++ b/Completion/BSD/Command/_portmaster @@ -5,7 +5,7 @@ _portmaster_pkgs() { } _portmaster_ports() { - local ret=1 _fbsd_ports _fbsd_cat + 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 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/_sockstat b/Completion/BSD/Command/_sockstat index daad946fc..913f3eb05 100644 --- a/Completion/BSD/Command/_sockstat +++ b/Completion/BSD/Command/_sockstat @@ -28,6 +28,7 @@ case $OSTYPE in '*-j[show sockets belonging to JID]: : _jails -0 -o jid' '-L[exclude loopback]' '*-P+[specify protocol]: : _values -s , protocols $protocols' + '-s[display protocol state if applicable]' ) ;; netbsd*) diff --git a/Completion/BSD/Command/_sysrc b/Completion/BSD/Command/_sysrc index d8bc4ef0e..246d73bd3 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 variable ${^rc_conf_vars%%\[*}'::value' && ret=0 else - _values -w -C variable ${^rc_conf_vars}'::value' + _values -w 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' |