diff options
Diffstat (limited to 'Completion')
97 files changed, 1741 insertions, 476 deletions
diff --git a/Completion/BSD/Command/_ipfw b/Completion/BSD/Command/_ipfw index b910aa34d..78dac206a 100644 --- a/Completion/BSD/Command/_ipfw +++ b/Completion/BSD/Command/_ipfw @@ -284,7 +284,7 @@ actions=( \| $'/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' + \| $word ':parameters:config parameter:$ca ip if log deny_in same_ports unreg_only unreg_cgn udp_eim 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' \) diff --git a/Completion/BSD/Command/_jail b/Completion/BSD/Command/_jail index 26d0a6a87..c3ccc5379 100644 --- a/Completion/BSD/Command/_jail +++ b/Completion/BSD/Command/_jail @@ -1,7 +1,7 @@ #compdef jail local curcontext="$curcontext" ret=1 -local -a state state_descr line jails running alts suf +local -a state state_descr line alts suf local -A opt_args _arguments -C -s \ @@ -32,19 +32,21 @@ if [[ -n $state ]]; then *) _message -e values 'value' ;; esac elif compset -P name= || [[ $#line = 1 ]]; then - if (( $+opt_args[-r] || $+opt_args[-m] )); then - alts=( 'jails:jail:_jails' ) + if (( $+opt_args[-r] || $+opt_args[-R] || $+opt_args[-m] )); then + alts=( 'jails:: _jails' ) elif (( $+opt_args[-c] )); then - running=( ${${(f)"$(_call_program jails jls name)"}/ /:} ) - jails=( ${${(M)${(f)"$(<${opt_args[-f]:-/etc/jail.conf})"}:#[a-z]# #\{#(#e)}%% *} ) - alts=( "jails:jail:compadd - ${jails:|running}" ) + if (( $+opt_args[-f] )); then + alts=( "jails:: _jails -c -f ${(q-)opt_args[-f]}" ) + else + alts=( 'jails:: _jails -c' ) + fi fi fi - if [[ -z $IPREFIX ]]; then + if [[ -z $IPREFIX ]] && (( ! $+opt_args[-r] && ! $+opt_args[-R] )); then compset -S '=*' || suf=( -qS = ) alts+=( - 'parameters:parameter:compadd -r "\n\t\- =" - persist allow.{set_hostname,sysvipc,raw_sockets,chflags,mount{,.devfs,.fdescfs,.nullfs,.procfs,.linprocfs,.linsysfs,.tmpfs,.zfs},quotas,socket_af} mount.{devfs,fdescfs,procfs}' - 'parameters:parameter:compadd $suf - jid name path ip{4,6}{,.addr{,sel}} vnet host.hostname host securelevel devfs_ruleset children.{max,cur} enforce_statfs cpuset.id osrelease osreldate command exec.{{,pre,post}{start,stop},clean,jail_user,system{,_jail}_user,timeout,consolelog,fib} stop.timeout {vnet.,}interface ip_hostname mount{,.fstab} depend' + 'parameters:parameter:compadd -r "\n\t\- =" - persist allow.{set_hostname,sysvipc,raw_sockets,chflags,mount{,.devfs,.fdescfs,.fusefs,.nullfs,.procfs,.linprocfs,.linsysfs,.tmpfs,.zfs},vmm,quotas,read_msgbuf,socket_af,mlock,nfsd,reserved_ports,unprivileged_{parent_tampering,proc_debug},suser,extattr,adjtime,settime,routing,setaudit} linux linux.{osrelease,oss_version} mount.{devfs,fdescfs,procfs}' + 'parameters:parameter:compadd $suf - jid name path ip{4,6}{,.addr,saddrsel} vnet host.hostname host securelevel devfs_ruleset children.{max,cur} enforce_statfs cpuset.id osrelease osreldate meta env command exec.{{,pre,post}{start,stop},clean,jail_user,system{,_jail}_user,timeout,consolelog,fib} stop.timeout {vnet.,}interface ip_hostname mount{,.fstab} depend zfs.dataset' ) fi (( $#alts )) && _alternative $alts && ret=0 diff --git a/Completion/BSD/Command/_jls b/Completion/BSD/Command/_jls index a6f8a7eb6..f9ae10253 100644 --- a/Completion/BSD/Command/_jls +++ b/Completion/BSD/Command/_jls @@ -4,13 +4,14 @@ local curcontext=$curcontext state state_descr line typeset -A opt_args _arguments -C -s -w -A '-*' : \ - '-d[include diying jails]' \ - '-h[print header line]' \ - "-N[print jail's name instead of numeric ID]" \ - '-n[print parameters in ``name=value'\'\'' format]' \ - '-q[quote parameter value when it contains whitespace, quotes or empty string]' \ - '-s[print parameters suitable for passing to jail(8)]' \ - '-v[print a multiple-line summary per jail]' \ + "(-h -N -n -q -s -v *)-c[only check for the jail's existence]" \ + '-d[include dying jails]' \ + '(-c)-h[print header line]' \ + "(-c)-N[print jail's name instead of numeric ID]" \ + '(-c)-n[print parameters in ``name=value'\'\'' format]' \ + '(-c)-q[quote parameter value when it contains whitespace, quotes or empty string]' \ + '(-c)-s[print parameters suitable for passing to jail(8)]' \ + '(-c)-v[print a multiple-line summary per jail]' \ '-j[the jid or name of the jail to list]:jail:_jails' \ '*: :->parameters' diff --git a/Completion/BSD/Command/_kdump b/Completion/BSD/Command/_kdump index e5c7c4cce..45fe77137 100644 --- a/Completion/BSD/Command/_kdump +++ b/Completion/BSD/Command/_kdump @@ -37,7 +37,7 @@ local args=( '-t[select which tracepoints to display]: :_ktrace_points' ) -case $OSTYPE; in +case $OSTYPE in freebsd*|netbsd*) args+=( '(-R -T)-E[display elapsed timestamps]' diff --git a/Completion/BSD/Command/_ktrace b/Completion/BSD/Command/_ktrace index 9613ba2bf..99dc23d1a 100644 --- a/Completion/BSD/Command/_ktrace +++ b/Completion/BSD/Command/_ktrace @@ -13,7 +13,7 @@ local args=( '*:: : _normal -p ktrace' ) -case $OSTYPE; in +case $OSTYPE in openbsd*) args+=( '-B[process relocations immediately]' diff --git a/Completion/BSD/Command/_mdo b/Completion/BSD/Command/_mdo new file mode 100644 index 000000000..9bb5224e8 --- /dev/null +++ b/Completion/BSD/Command/_mdo @@ -0,0 +1,48 @@ +#compdef mdo + +local environ e cmd cpp sep +local -a _comp_priv_prefix suf reset +local curcontext="$curcontext" state line expl +local -A opt_args + +zstyle -a ":completion:${curcontext}:" environ environ + +for e in "${environ[@]}" +do local -x "$e" +done + +cmd="$words[1]" +cpp='_comp_priv_prefix=( $cmd ${(kv)opt_args} )' +_arguments -s -S -A '-*' : \ + '(- *)-h[display usage information]' \ + '--euid=[override effective user]:user:_users' \ + '--egid=[override effective group]:group:_groups' \ + '-G+[set supplementary groups]:group:_sequence _groups' \ + '-g+[set primary group]:group:_groups' \ + '-i[keep current primary and supplementary groups]' \ + '(-u -i)-k[use current credentials as baseline]' \ + '--ruid=[override real user]:user:_users' \ + '--rgid=[override real group]:group:_groups' \ + '-s+[incrementally modify the supplementary groups set]: :->group-mods' \ + '--svuid=[override saved user]:user:_users' \ + '--svgid=[override saved group]:group:_groups' \ + '-u+[run command as specified user]: :_users' \ + "(-)1: :{ $cpp; _command_names -e }" \ + "*:: :{ $cpp; _normal }" && return + +if [[ $state = group-mods ]]; then + line=( + $opt_args[-g] ${(s.,.)opt_args[-G]} + ${${(s.,.)${(M)PREFIX##*,}}#[-+@]} + ${${(s.,.)${(M)SUFFIX%%,*}}#[-+@]} + ) + compset -P '*,' || reset=( @ ) + compset -S ',*' || suf=( -qS, ) + if ! compset -P '[-+@]'; then + zstyle -s ":completion:${curcontext}:modifiers" list-separator sep || sep=-- + _wanted modifiers expl 'group modifier' compadd -S "" -d \ + "(-\ $sep\ exclude +\ $sep\ include @\ $sep\ reset)" - - + $reset + else + _wanted groups expl group _groups $suf -F line + fi +fi diff --git a/Completion/BSD/Command/_pfctl b/Completion/BSD/Command/_pfctl index 8063eb504..7756239d8 100644 --- a/Completion/BSD/Command/_pfctl +++ b/Completion/BSD/Command/_pfctl @@ -94,6 +94,7 @@ case $OSTYPE in args+=( '-M[kill matching states in the opposite direction]' '-P[display ports numerically]' + "-S[don't perform domain name resolution]" ) ;; esac diff --git a/Completion/BSD/Command/_sockstat b/Completion/BSD/Command/_sockstat index 953072429..a5c29e116 100644 --- a/Completion/BSD/Command/_sockstat +++ b/Completion/BSD/Command/_sockstat @@ -31,10 +31,16 @@ case $OSTYPE in ;| freebsd<14->.*) args+=( + '-b[show TCP black box logging socket state]' '-I[show local address of socket to which the current socket is spliced]' '-f[show the FIB number of each socket]' ) ;| + freebsd<15->.*) + args+=( + '-A[show address of associated protocol control block (PCB)]' + ) + ;| freebsd*) for proto in ${${(M)${(f)"$(</etc/protocols)"}##[a-z0-9]*}}; do case $proto in diff --git a/Completion/BSD/Type/_jails b/Completion/BSD/Type/_jails index 89e34ba4f..7b990b585 100644 --- a/Completion/BSD/Type/_jails +++ b/Completion/BSD/Type/_jails @@ -3,15 +3,52 @@ # Options: # # -0 include jid 0 as a match for the host system +# -c complete configured jails that aren't currently running +# -f file override config file (default: sysrc -n jail_conf) # -o param jail parameter to complete instead of jid - # e.g. name, path, ip4.addr, host.hostname -local addhost host param desc=1 -local -a jails args expl -zparseopts -D -K -E 0=addhost o:=param +local addhost host param desc=1 configured +local -a jails args expl fopt match mbegin mend +zparseopts -D -K -E 0=addhost c=configured f:=fopt o:=param param=${param[2]:-name} jails=( ${${(f)"$(_call_program jails jls $param name)"}/ /:} ) + +if [[ -n $configured ]]; then + local jail_conf line f include_pat content + local -a conf_files cjails running_names raw + include_pat="(#b)[[:space:]]#.include[[:space:]]##[\"']([^\"']##)[\"']*" + + if (( $#fopt )); then + jail_conf=${fopt[2]} + else + jail_conf=$(_call_program paths sysrc -n jail_conf) + fi + + # Follow .include directives (accepts both "..." and '...' paths) + if [[ -r $jail_conf ]]; then + while IFS= read -r line; do + [[ $line = ${~include_pat} ]] && conf_files+=( ${~match[1]}(N) ) + done < $jail_conf + conf_files+=( $jail_conf ) + fi + + # Extract jail block names: lines matching "name {" (optionally indented). + # Collapse "name\n{" forms to "name {" first so the same pattern catches both. + for f in ${(u)conf_files}; do + [[ -r $f ]] || continue + content=$(< $f) + content=${content//$'\n'[[:space:]]#\{/' {'} + raw=( ${(M)${(f)content}:#[[:space:]]#[^#[:space:]]##[[:space:]]#\{*} ) + cjails+=( ${${raw##[[:space:]]#}%%[[:space:]]#\{*} ) + done + + # Replace jails with configured-minus-running; exclude wildcard blocks + running_names=( ${jails%:*} ) + jails=( ${(u)${cjails:#\*}:|running_names} ) +fi + case $param in jid) host=0 ;; name) diff --git a/Completion/Base/Completer/_all_matches b/Completion/Base/Completer/_all_matches index 59a6d8060..5f6841551 100644 --- a/Completion/Base/Completer/_all_matches +++ b/Completion/Base/Completer/_all_matches @@ -28,7 +28,7 @@ _all_matches_end() { local not zstyle -s "$_all_matches_context" avoid-completer not || - not=( _expand _old_list _correct _approximate ) + not=( _expand _oldlist _correct _approximate ) if [[ "$compstate[nmatches]" -gt 1 && $not[(I)(|_)$_completer] -eq 0 ]]; then local expl diff --git a/Completion/Base/Utility/_numbers b/Completion/Base/Utility/_numbers index 069fc75a4..257e267a8 100644 --- a/Completion/Base/Utility/_numbers +++ b/Completion/Base/Utility/_numbers @@ -37,7 +37,8 @@ # _description is called with the x token set to make the completed # list of suffixes available to the normal format style -local desc tag range suffixes suffix suffixfmt pat='<->' partial='' +local MATCH MBEGIN MEND +local desc tag range suffixes suffix suffixfmt pad pat='<->' partial='' local -a expl formats local -a default max min keep tags units local -i i @@ -56,7 +57,9 @@ desc="${1:-number}" tag="${tags[2]:-numbers}" if (( $#argv )) && compset -P "$pat"; then zstyle -s ":completion:${curcontext}:units" list-separator sep || sep=-- _description -V units expl unit - disp=( ${${argv#:}/:/ $sep } ) + pad=${#${(O)${${argv%%:*}//?/.}}[1]} # length of longest suffix + disp=( ${${argv#:}/(#m)[^:]##/${(pr<$pad>< >)MATCH}} ) # pad suffixes + disp=( ${disp/:/ $sep } ) compadd -M 'r:|/=* r:|=*' -d disp "$keep[@]" "$expl[@]" - ${${argv#:}%%:*} return elif [[ -prefix $~pat || $PREFIX = $~partial ]]; then @@ -70,10 +73,10 @@ elif [[ -prefix $~pat || $PREFIX = $~partial ]]; then zstyle -s ":completion:${curcontext}:unit-suffixes" format suffixfmt || \ suffixfmt='%(d.%U.)%x%(d.%u.)%(r..|)' for ((i=0;i<$#;i++)); do - zformat -f suffix "$suffixfmt" "x:${${argv[i+1]#:}%%:*}" \ - "X:${${argv[i+1]#:}#*:}" "d:${#${argv[i+1]}[1]#:}" \ + zformat -f suffix "$suffixfmt" "x:${${${argv[i+1]#:}%%:*}//\%/%%}" \ + "X:${${${argv[i+1]#:}#*:}//\%/%%}" "d:${#${argv[i+1]}[1]#:}" \ i:i r:$(( $# - i - 1)) - suffixes+="${suffix//\%/%%}" + suffixes+=$suffix done [[ -n $suffixes ]] && formats+=( x:$suffixes ) diff --git a/Completion/Base/Utility/_values b/Completion/Base/Utility/_values index 5ed79e890..a8a14c73f 100644 --- a/Completion/Base/Utility/_values +++ b/Completion/Base/Utility/_values @@ -59,8 +59,8 @@ if compvalues -i "$keep[@]" "$@"; then _describe "$descr" \ noargs "$sep[@]" -M 'r:|[_-]=* r:|=*' -- \ - args -S "${argsep}" -M 'r:|[_-]=* r:|=*' -- \ - opts -qS "${argsep}" -r "${argsep}${sep[2]} \\t\\n\\-" -M 'r:|[_-]=* r:|=*' + args -S "${argsep}" -r "${argsep}${sep[2]}" -M 'r:|[_-]=* r:|=*' -- \ + opts -S "${argsep}" -r "${argsep}${sep[2]} \\t\\n\\-" -M 'r:|[_-]=* r:|=*' curcontext="$oldcontext" diff --git a/Completion/Cygwin/Command/_cygcheck b/Completion/Cygwin/Command/_cygcheck index e0d7532e2..018c891a5 100644 --- a/Completion/Cygwin/Command/_cygcheck +++ b/Completion/Cygwin/Command/_cygcheck @@ -18,7 +18,7 @@ _arguments -C -s -S \ '(* -)'{-l,--list-package}'[list contents of the specified package (or all packages if none given)]:*:package:->package' \ '(* -)'{-p,--package-query}'[search for the specified regexp in the entire cygwin.com package repository (requires internet connectivity)]:regexp:' \ '(-V --version -k --keycheck -f --find-package -l --list-package -p --package-query -c --check-setup -d --dump-only -v --verbose)'{-v,--verbose}'[produce more verbose output]' \ - '(-V --version -k --keycheck -f --find-package -l --list-package -p --package-query -c --check-setup -d --dump-only -h --help)'{-h,--help}'[annotate output with explanatory comments when given with another command, otherwise print this help]' \ + '(-V --version -k --keycheck -f --find-package -l --list-package -p --package-query -c --check-setup -d --dump-only -h --help)'{-h,--help}'[annotate output with explanatory comments when given with another command, otherwise print generic help]' \ '(* -)'{-V,--version}'[print the version of cygcheck and exit]' \ '(-)*:program: _command_names -e' && return diff --git a/Completion/Darwin/Command/_caffeinate b/Completion/Darwin/Command/_caffeinate index 9e361a5bd..f7d67695b 100644 --- a/Completion/Darwin/Command/_caffeinate +++ b/Completion/Darwin/Command/_caffeinate @@ -6,7 +6,7 @@ _arguments -s -S : \ '-m[prevent disk idle sleep]' \ '-s[prevent system sleep (AC power only)]' \ '-u[declare that user is active]' \ - '(:)-t[specify assertion timeout value]:timeout (seconds)' \ - '(:)-w[wait for specified PID]: :_pids' \ + '(:)-t+[specify assertion timeout value]:timeout (seconds)' \ + '(:)-w+[wait for specified PID]: :_pids' \ '(-)1: : _command_names -e' \ '(-)*::command argument' diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index 19c2dfc8c..ac3095a4d 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -468,7 +468,9 @@ _apt-cmd () { /$'full-upgrade\0'/ \| \ /$'dist-upgrade\0'/ \| \ /$'edit-sources\0'/ /$'[^\0]#\0'/ ': ::_apt_sources' \# \| \ - /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge why why-not' + /$'history-list\0'/ \| \ + /$'(history-(info|redo|undo|rollback))\0'/ /$'[^\0]#\0'/ ': ::_apt_history_ids' \# \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge why why-not history-list history-info history-redo history-undo history-rollback' _apt-cmd () { local expl_action expl_packages subcmd @@ -793,4 +795,10 @@ _apt_snapshot_dates() { _wanted list expl 'wayback date (yyyymmdd[ThhmmssZ])' compadd -- $dates } +_apt_history_ids() { + local -a expl historyids + historyids=( ${${${(f)"$(_call_program history-ids apt history-list)"}:#ID*}%% *} ) + _wanted history-ids expl 'history id' compadd -o numeric,reverse -a historyids +} + _apt "$@" diff --git a/Completion/Debian/Command/_dak b/Completion/Debian/Command/_dak index 9976c7371..0c1d82f84 100644 --- a/Completion/Debian/Command/_dak +++ b/Completion/Debian/Command/_dak @@ -37,7 +37,7 @@ case $cmd in '(-n --no-action)'{-n,--no-action}'[do not do anything]' '(-s --suite)'{-s,--suite=}':suite:_values -s , "suite list" oldstable stable testing unstable experimental' ':package:_deb_packages avail' - ':section:(admin base comm contrib/admin contrib/comm contrib/devel contrib/doc contrib/games contrib/graphics contrib/interpreters contrib/kde contrib/libdevel contrib/libs contrib/mail contrib/math contrib/misc contrib/net contrib/otherosfs contrib/perl contrib/python contrib/science contrib/sound contrib/tex contrib/text contrib/utils contrib/web contrib/x11 devel doc editors electronics embedded games gnome graphics hamradio interpreters kde libdevel libs mail math misc net news non-free/admin non-free/base non-free/comm non-free/devel non-free/doc non-free/editors non-free/electronics non-free/games non-free/graphics non-free/hamradio non-free/libdevel non-free/libs non-free/mail non-free/math non-free/misc non-free/net non-free/news non-free/otherosfs non-free/python non-free/science non-free/sound non-free/tex non-free/text non-free/utils non-free/web non-free/x11 oldlibs otherosfs perl python science shells sound tex text utils web x11)' + ':section:({,contrib/,non-free/}{admin,cli-mono,comm,database,debug,devel,doc,editors,education,electronics,embedded,fonts,games,gnome,gnu-r,gnustep,graphics,hamradio,haskell,httpd,interpreters,introspection,java,javascript,kde,kernel,libdevel,libs,lisp,localization,mail,math,metapackages,misc,net,news,ocaml,oldlibs,otherosfs,perl,php,python,ruby,rust,science,shells,sound,tex,text,utils,vcs,video,web,x11,xfce,zope})' ':priority:(extra important optional required standard)' ) ;; diff --git a/Completion/Debian/Command/_debfoster b/Completion/Debian/Command/_debfoster index 08a1078e2..3e2231d73 100644 --- a/Completion/Debian/Command/_debfoster +++ b/Completion/Debian/Command/_debfoster @@ -44,10 +44,13 @@ if [[ -n "$state" ]]; then ;; *(#i)(no|)keepsections*) _wanted values expl 'section' compadd \ - x11 web utils text tex sound shells science \ - otherosfs oldlibs news net misc math mail libs \ - interpreters hamradio graphics games electronics \ - editors doc devel comm base admin && ret=0 + zope xfce x11 web video vcs utils text tex sound shells \ + science rust ruby python php perl otherosfs oldlibs ocaml \ + news net misc metapackages math mail localization lisp libs \ + libdevel kernel kde javascript java introspection \ + interpreters httpd haskell hamradio graphics gnustep gnu-r \ + gnome games fonts embedded electronics education editors doc \ + devel debug database comm cli-mono admin && ret=0 ;; *(#i)guessdepends*) _wanted values expl 'name extension' \ diff --git a/Completion/Linux/Command/_acpi b/Completion/Linux/Command/_acpi index 850687506..5ebf1447c 100644 --- a/Completion/Linux/Command/_acpi +++ b/Completion/Linux/Command/_acpi @@ -14,5 +14,5 @@ _arguments -s \ '(-c --celsius -f --fahrenheit -k --kelvin)'{-f,--fahrenheit}'[use Fahrenheit as the temperature scale]' \ '(-c --celsius -f --fahrenheit -k --kelvin)'{-k,--kelvin}'[use Kelvin as the temperature scale]' \ '(-d --directory)'{-d,--directory}'[path to ACPI info (/proc/acpi)]:directory:_files -/' \ - '(-h --help)'{-h,--help}'[display this help and exit]' \ + '(-h --help)'{-h,--help}'[display help and exit]' \ '(-v --version)'{-v,--version}'[output version information and exit]' diff --git a/Completion/Linux/Command/_btrfs b/Completion/Linux/Command/_btrfs index d8b97a200..539416321 100644 --- a/Completion/Linux/Command/_btrfs +++ b/Completion/Linux/Command/_btrfs @@ -155,9 +155,9 @@ while (( $#state )); do '-c-[compress files while defragmenting]::compression algorithm:(zlib lzo zstd)' '-r[defragment files recursively]' '-f[flush after defragmenting]' - '-s[start position]: :_numbers -u bytes -d "beginning of file" offset K M G T P E' - '-l[defragment limited number of bytes]: :_numbers -u bytes length K M G T P E' - '-t[defragment only extents up to a certain size]: :_numbers -u bytes -d 32M "maximum extent size" K M G T P E' + '-s+[start position]: :_numbers -u bytes -d "beginning of file" offset K M G T P E' + '-l+[defragment limited number of bytes]: :_numbers -u bytes length K M G T P E' + '-t+[defragment only extents up to a certain size]: :_numbers -u bytes -d 32M "maximum extent size" K M G T P E' '*:file:_files' ) ;; @@ -213,8 +213,8 @@ while (( $#state )); do '-d[print separate statistics for each device]' '-r[read only mode]' '-R[raw print mode]' - '-c[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))' - '-n[set ioprio classdata]:classdata:(0 1 2 3 4 5 6 7)' + '-c+[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))' + '-n+[set ioprio classdata]:classdata:(0 1 2 3 4 5 6 7)' '1:path or device:_files' ) [[ ${${(P)group}[cmd]} == start ]] && args+=( @@ -246,7 +246,7 @@ while (( $#state )); do property:get) args+=( '2:property:(ro label compression)' );& property:list) args+=( - '-t[specify object type]:object type:(subvol filesystem inode device)' + '-t+[specify object type]:object type:(subvol filesystem inode device)' '1: : _guard "^-*" object' ) ;; diff --git a/Completion/Linux/Command/_ipset b/Completion/Linux/Command/_ipset index a40480904..1f29c63ec 100644 --- a/Completion/Linux/Command/_ipset +++ b/Completion/Linux/Command/_ipset @@ -45,9 +45,9 @@ hash=( '--hashsize[the initial hash size aligned to a power of 2]:hashsize [1024 '--resize[ratio of increasing hash size after unsuccessful <probes> of double-hashing, altering discouraged]:percent' ) -case $words[offset+2]; in +case $words[offset+2] in -N|--create) - case $words[offset+4]; in + case $words[offset+4] in bitmap\:ip) args=( $from_to '--netmask[store network addresses instead of IP addresses]:CIDR' diff --git a/Completion/Linux/Command/_iptables b/Completion/Linux/Command/_iptables index 0a901f0f2..2ac13b481 100644 --- a/Completion/Linux/Command/_iptables +++ b/Completion/Linux/Command/_iptables @@ -29,7 +29,7 @@ ropts=( ) prev=( ${words[1,CURRENT-1]} ) -case ${prev[${prev[(I)-p|--proto|--protocol]}+1]}; in +case ${prev[${prev[(I)-p|--proto|--protocol]}+1]} in tcp) args=( '--tcp-flags[match based on TCP flags in a packet]: :->tcp-flags: :->tcp-flags' @@ -46,7 +46,7 @@ case ${prev[${prev[(I)-p|--proto|--protocol]}+1]}; in icmp) args=( '--icmp-type[match specified ICMP type]:*^!:ICMP type:->icmp-types' ) ;; esac -case ${prev[${prev[(I)-j|--jump]}+1]}; in +case ${prev[${prev[(I)-j|--jump]}+1]} in DNAT) args+=( '(--to --to-destination)'{--to,--to-destination}':address' ) ;; DSCP) args+=( @@ -91,7 +91,7 @@ typeset -U args while (( i=words[(ib.i.)-m|--match]+1 )) (( i<CURRENT )); do - case ${words[i]}; in + case ${words[i]} in addrtype) args+=( '--src-type[match if the source address is of given type]:type:->address-types' diff --git a/Completion/Linux/Command/_mdadm b/Completion/Linux/Command/_mdadm index 5b73ef4be..89c3ac036 100644 --- a/Completion/Linux/Command/_mdadm +++ b/Completion/Linux/Command/_mdadm @@ -71,14 +71,14 @@ _layouts () { if (( $+words[(r)-(A|-assemble)] )); then args=( '(--bitmap)'--bitmap='[bitmap file to use with the array]::bitmap file:_files' - '(--uuid -u)'{--uuid=,-u}'[UUID of array to assemble]:UUID' - '(--super-minor -m)'{--super-minor=,-m}'[minor number to look for in super-block]:minor number' - '(--name -N)'{--name=,-N}'[array name to look for in super-block]:array name' - '(--config -c)'{--config=,-c}'[config file]::config file:_files' + '(--uuid -u)'{--uuid=,-u+}'[UUID of array to assemble]:UUID' + '(--super-minor -m)'{--super-minor=,-m+}'[minor number to look for in super-block]:minor number' + '(--name -N)'{--name=,-N+}'[array name to look for in super-block]:array name' + '(--config -c)'{--config=,-c+}'[config file]::config file:_files' '(--scan -s)'{--scan,-s}'[scan config file for missing information]' '(--run -R)'{--run,-R}'[try to start the array even if not enough devices for a full array are present]' '(--force -f)'{--force,-f}'[assemble the array even if some superblocks appear out-of-date]' - '(--update -U)'{--update=,-U}'[update superblock]::update the superblock:(sparc2.2 summaries uuid resync byteorder super-minor)' + '(--update -U)'{--update=,-U+}'[update superblock]::update the superblock:(sparc2.2 summaries uuid resync byteorder super-minor)' ) fi diff --git a/Completion/Linux/Command/_opkg b/Completion/Linux/Command/_opkg index ddaefe1eb..f726a3e32 100644 --- a/Completion/Linux/Command/_opkg +++ b/Completion/Linux/Command/_opkg @@ -181,7 +181,7 @@ _opkg_dest_path() { _opkg_pkg_all() { local -a upd copts - zparseopts -a upd -D -E -update + zparseopts -a upd -D -E - -update copts=( "$@" ) { (( ! $#_opkg_cache_pkg_all )) || _cache_invalid opkg-pkg-all } && @@ -207,7 +207,7 @@ _opkg_pkg_all() { _opkg_pkg_inst() { local -a upd copts - zparseopts -a upd -D -E -update + zparseopts -a upd -D -E - -update copts=( "$@" ) { (( ! $#_opkg_cache_pkg_inst )) || _cache_invalid opkg-pkg-inst } && @@ -233,7 +233,7 @@ _opkg_pkg_inst() { _opkg_pkg_new() { local -a upd copts - zparseopts -a upd -D -E -update + zparseopts -a upd -D -E - -update copts=( "$@" ) { (( ! $#_opkg_cache_pkg_new )) || _cache_invalid opkg-pkg-new } && @@ -257,7 +257,7 @@ _opkg_pkg_new() { _opkg_pkg_upgr() { local -a upd copts - zparseopts -a upd -D -E -update + zparseopts -a upd -D -E - -update copts=( "$@" ) { (( ! $#_opkg_cache_pkg_upgr )) || _cache_invalid opkg-pkg-upgr } && diff --git a/Completion/Linux/Command/_selinux b/Completion/Linux/Command/_selinux index 22d78db7d..1b2c25468 100644 --- a/Completion/Linux/Command/_selinux +++ b/Completion/Linux/Command/_selinux @@ -148,6 +148,7 @@ case $service in '(-o --output -M --module-package)'{-o+,--output=}'[append output to file]:file:_files' '(-D --dontaudit)'{-D,--dontaudit}'[generate policy with dontaudit rules]' '(-R --reference)'{-R,--reference}'[use installed macros in generated policy]' + '(-C --cil)'{-C,--cil}'[generate CIL output]' '!(-R --reference -N --noreference)'{-N,--noreference} '(-v --verbose)'{-v,--verbose}'[explain generated output]' '(-e --explain)'{-e,--explain}'[fully explain generated output]' @@ -196,7 +197,7 @@ case $service in args+=( "${ign}(-)"{-V,--version}'[show policy versions created by this program]' '-m[build a policy module instead of a base module]' - '-c+[build a policy module targeting a modular policy version]:version (4-21)' + '-c+[build a policy module targeting a modular policy version]:version (4-22)' ) ;; @@ -548,7 +549,7 @@ case $service in ;; fcontext) args+=( - '(-e --equal)'{-e+,--equal=}'[substitute target path with sourcepath when generating default label]:equal' + '(-e --equal)'{-e+,--equal=}'[substitute target path with source path when generating default label]:equivalent path:_files' '(-f --ftype)'{-f+,--ftype=}'[specify file type]:file type:(( f\:regular\ file d\:directory diff --git a/Completion/Linux/Command/_strace b/Completion/Linux/Command/_strace index 37e14b6d6..6f42c4ae0 100644 --- a/Completion/Linux/Command/_strace +++ b/Completion/Linux/Command/_strace @@ -24,7 +24,9 @@ _arguments -C -s \ '(-z -Z --successful-only --failed-only)'{-Z,--failed-only}'[trace only system calls that return an error]' \ '(-a --columns)'{-a+,--columns=}'[align return values in a specific column]:column number [40]' \ '(-i --instruction-pointer -c --summary-only)'{-i,--instruction-pointer}'[print instruction pointer at time of syscall]' \ - '(-c --summary-only -k --stack-traces)'{-k,--stack-traces}'[obtain stack trace between each syscall]' \ + '(-c --summary-only)*-k[obtain stack trace between each syscall]' \ + '(-c --summary-only -k)--stack-trace=-[obtain stack trace between each syscall]::symbol' \ + '(-c --summary-only)--stack-trace-frame-limit=[specify limit on stack trace frames to print]:frames [256]' \ '(-n --syscall-number)'{-n,--syscall-number}'[print syscall number]' \ '(-o --output)'{-o+,--output=}'[send trace output to the specified file]:output file:->file-pipe' \ '(-A --output-append-mode)'{-A,--output-append-mode}'[open the file provided with the -o option in append mode]' \ @@ -51,11 +53,12 @@ _arguments -C -s \ '(-X --const-print-style)'{-X+,--const-print-style=}'[set the format for printing of named constants and flags]:format:(raw abbrev verbose)' \ '(-c --summary-only -yy --decode-fds)-y[print paths associated with file descriptor arguments]' \ '(-c --summary-only -y --decode-fds)-yy[print protocol specific information associated with socket file descriptors]' \ - '(-c --summary-only -y -yy)--decode-fds=-[print information associated with file descriptors]::information [none]:_sequence compadd - none all path socket dev pidfd signalfd' \ + '(-c --summary-only -y -yy)--decode-fds=-[print information associated with file descriptors]::information [none]:_sequence compadd - none all path socket dev eventfd pidfd signalfd' \ '(-c --summary-only -Y)--decode-pids=[print information associated with process IDs]:information [none]:_sequence compadd - none comm pidns' \ '!(-c --summary-only -Y --decode-pids)--pidns-translation' \ '(-c --summary-only --decode-pids)-Y[print command names for PIDs]' \ - '(-c --summary-only -C --summary -i --instruction-pointer -k --stack-traces -r --relative-timestamps -ff -t -tt -ttt --absolute-timestamps -T --syscall-times -y -yy --decode-fds)'{-c,--summary-only}'[count time, calls, and errors for each system call and report a summary]' \ + '--always-show-pid' \ + '(-c --summary-only -C --summary -i --instruction-pointer -k --stack-trace --stack-trace-frame-limit -r --relative-timestamps -ff -t -tt -ttt --absolute-timestamps -T --syscall-times -y -yy --decode-fds)'{-c,--summary-only}'[count time, calls, and errors for each system call and report a summary]' \ '(-c --summary-only -C --summary)'{-C,--summary}'[count time, calls, and errors for each system call and report a summary in addition to regular output]' \ '(-O --summary-syscall-overhead)'{-O+,--summary-syscall-overhead=}'[specify overhead for tracing system calls]:overhead (microseconds)' \ '(-S --summary-sort-by)'{-S+,--summary-sort-by=}'[sort the output of the histogram (-c option) by the specified criterion]:sort criterion [time]:(time min-time max-time avg-time calls errors name nothing)' \ @@ -66,6 +69,11 @@ _arguments -C -s \ '(-d --debug)'{-d,--debug}'[show debug output of strace itself on standard error]' \ '(- 1 *)'{-h,--help}'[display help information]' \ '--seccomp-bpf[enable seccomp-bpf filtering]' \ + '--secontext=[print SELinux contexts]: : _values -s, format + "(none mismatch full)all[equivalent to full,mismatch]" + "(all none)full[print the full context instead of the type only]" + "(all none)mismatch[print expected context when actual is not matching]" + "(all none mismatch full)none[equivalent to not specifying the option at all]"' \ '--tips=-[show strace tips, tricks, and tweaks before exit]:tip [id\:random,format\:compact]' \ '(- 1 *)'{-V,--version}'[display version information]' \ '(-):command name: _command_names -e' \ @@ -87,7 +95,8 @@ case $state in 'status[trace system calls with given return status]:status:->status' \ 'quiet[suppress various information messages]:message [none]:_sequence compadd - none attach exit path-resolution personality thread-execve superseded' \ 'kvm[print the exit reason of kvm vcpu]: :(vcpu)' \ - 'decode-fds[print information associated with file descriptors]:information [none]:_sequence compadd - none all path socket dev pidfd signalfd' \ + 'decode-fds[print information associated with file descriptors]:information [none]:_sequence compadd - none all path socket dev eventfd pidfd signalfd' \ + 'secontext' \ 'decode-pids[print information associated with process IDs]:information [none]:_sequence compadd - none comm pidns' && ret=0 if [[ $state = status ]]; then _values -s , 'return status [all]' \ diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind index 6bf0e4450..47fced1fd 100644 --- a/Completion/Linux/Command/_valgrind +++ b/Completion/Linux/Command/_valgrind @@ -2,7 +2,7 @@ local curcontext="$curcontext" state line local -a cmd common_{own_malloc,read_varinfo,report_errors,partial} -local -a args args_{addrcheck,drd,memcheck,cachegrind,helgrind,lackey,massif,none,exp_{bbv,dhat,sgcheck}} +local -a args args_{{addr,mem}check,drd,{cache,call,hel}grind,lackey,massif,none,exp_{bbv,dhat,sgcheck}} cmd=( '1: : _command_names -e' @@ -127,6 +127,38 @@ args_cachegrind=( '--cachegrind-out-file=-[specify output file name]:file name [cachegrind.out.%%p]:_files' ) +args_callgrind=( + '--callgrind-out-file=-[specify output file name]:file name [callgrind.out.%%p]:_files' + '--dump-line=-[perform event counting at source line granularity]:enable [yes]:(yes no)' + '--dump-instr=-[perform event counting at instruction granularity]:enable [no]:(yes no)' + '--compress-strings=-[identify file and function names by numbers]:enable [yes]:(yes no)' + '--compress-pos=-[compress positions in profile dump]:enable [yes]:(yes no)' + '--compress-dumps=-[concatenate all dumps into same file]:enable [no]:(yes no)' + '--dump-every-bb=-[specify dump period in basic blocks]:blocks [0, never]' + '*--dump-before=-[dump when entering specified function]:function' + '*--zero-before=-[zero all costs when entering specified function]:function' + '*--dump-after=-[dump when leaving specified function]:function' + '--instr-atstart=-[do instrumentation at callgrind start]:enable [yes]:(yes no)' + '--collect-atstart=-[collect at process/thread start]:enable [yes]:(yes no)' + '*--toggle-collect=-[toggle collection on enter/leave specified function]:function' + '--collect-jumps=-[collect jumps]:enable [no]:(yes no)' + '--collect-bus=-[collect global bus events]:enable [no]:(yes no)' + '--collect-systime=-[collect system call time info]:enable [no]:(no yes msec usec nsec)' + '--separate-threads=-[separate data per thread]:enable [no]:(yes no)' + '--separate-callers=-[separate functions by call chain length]:length [0]' + '--separate-recs=-[separate function recursions up to level]:level [2]' + '--skip-plt=-[ignore calls to/from PLT sections]:enable [yes]:(yes no)' + '--skip-direct-rec=-[ignore direct recursio]:enable [yes]:(yes no)' + '*--fn-skip=-[ignore calls to/from specified function]:function' + '--branch-sim=-[collect branch prediction stats]:enable [no]:(yes no)' + '--cache-sim=-[collect cache stats]:enable [no]:(yes no)' + '--simulate-wb=-[count write-back events]:enable [no]:(yes no)' + '--simulate-hwpref=-[simulate hardware prefetch]:enable [no]:(yes no)' + '--cacheuse=-[collect cache block use]:enable [no]:(yes no)' + '--I1=-[set I1 cache manually]:size,assoc,line_size' + '--D1=-[set D1 cache manually]:size,assoc,line_size' +) + args_helgrind=( $common_own_malloc $common_read_varinfo @@ -217,7 +249,8 @@ _arguments -C ${(P)args} $cmd \ '--vgdb=-[activate gdbserver]:enable [yes]:(yes no full)' \ '--vgdb-error=-[invoke gdbserver after specified number of errors]:errors [999999999]:errors' \ '--vgdb-stop-at=-[invoke gdbserver for given events]:event:_sequence compadd - startup exit abexit valgrindabexit all none' \ - '--track-fds=-[track open file descriptors]:enable [no]:(yes no all)' \ + '--track-fds=-[track open file descriptors]:enable [no]:(yes no all bad)' \ + '--modify-fds=-[modify newly open file descriptors]:enable:(yes no high)' \ '--time-stamp=-[add timestamps to log messages]:enable:(yes no)' \ '--log-fd=-[log messages to specified file descriptor]:file descriptor:_file_descriptors' \ '--log-file=-[log messages to specified file with pid appended]:file:_files' \ diff --git a/Completion/Unix/Command/_7zip b/Completion/Unix/Command/_7zip new file mode 100644 index 000000000..6867d353c --- /dev/null +++ b/Completion/Unix/Command/_7zip @@ -0,0 +1,209 @@ +#compdef 7z 7za 7zr 7zz + +# this covers both the official 7-zip and the now deprecated p7zip (but not the +# p7zip command, which is a gzip-like wrapper) +# +# notes: +# - seemingly all 7zip commands, options, and option arguments are +# case-insensitive. we only partially support this +# - most options only work with certain commands. the html documentation lists +# which ones, but it was so consistently wrong or contradictory that i gave up +# on trying to separate them. do not blindly trust the documentation on this + +local ret=1 +local -a context line state state_descr args +local -A opt_args + +args=( + '*-ai-[specify archives to include]: :->file-refs' + "(2)-an[don't take archive name on command line (with -ai)]" + '-ao-[specify overwrite mode]:overwrite mode:(( + a\:"overwrite existing files without prompt" + s\:"skip extracting files that already exist" + t\:"auto-rename existing files" + u\:"auto-rename extracting files" + ))' + '*-ax-[specify archives to exclude]: :->file-refs' + '-bb-[specify output log level]::log level:(( + 0\:"disable log" + 1\:"show names of processed files" + 2\:"show names of additional files processed internally" + 3\:"show information about additional operations" + ))' + '-bd[disable progress indicator]' + '*-bs-[specify output stream]: :->output-streams' + '-bt[show execution time statistics]' + '*-i-[specify files to include]: :->file-refs' + '*-m-[specify compression method parameter]:method parameter' # @todo complete these + '-o-[specify output directory]:output directory:_files -/' + '-p-[specify password]:password' + "-r-[recurse into subdirectories (or specify)]::recursion method:(( + -\:\"don't recurse into subdirectories\" + 0\:'recurse into subdirectories only for wildcard names' + ))" + '-sa-[specify archive naming mode]:archive naming mode:(( + a\:"always add archive type extension" + e\:"use file name exactly as given" + s\:"add archive type extension only if file name has no extension" + ))' + '-scc-[specify charset for console input/output]: :->charsets-io' + '-scrc-[specify hash function]: :->hash-functions' + '-scs-[specify charset for list files]: :->charsets-listfile' + '-sdel[delete files after adding to archive]' + '-seml-[send archive by e-mail (specify behaviour)]::e-mail behaviour:(( + .\:"delete archive after attaching to e-mail" + ))' + '-sfx-[create SFX archive]:: :->sfx-modules' + '-si-[compress data from stdin (specify file name)]::file name in archive:_files' + '-slt[show technical information]' + '-snc[extract as alternate stream if : in file name]' + '-snh[store hard links as links (tar and WIM only)]' + '-sni[store NTFS security information (WIM only)]' + '-snl[store symbolic links as links (tar and WIM only)]' + "-sns-[store NTFS alternate streams (or specify) (WIM only)]::alternate-streams behaviour:(( + -\:\"don't store NTFS alternate streams\" + ))" + "-snt-[replace trailing dots and spaces in file names (or specify)]::trailing-character behaviour:(( + -\:\"don't replace trailing dots and spaces in file names\" + ))" + '-so[write data to stdout]' + '-spd[disable wildcard matching for file names]' + '-spe[eliminate duplication of root folder]' + '-spf-[use fully qualified (absolute) file paths (or specify)]::absolute-file-path behaviour::(( + 2\:"use full path without leading slash or drive letter" + ))' + '-ssc-[enable case-sensitive mode (or specify)]::case-sensitive mode:(( + -\:"disable case-sensitive mode" + ))' + '-sse[stop archive creation if unable to open input file]' + "-ssp[don't change access time of source files]" + '-ssw[compress files open for writing by other programs]' + '-stl[set archive time stamp from most recently modified file]' + '-stm-[specify CPU thread affinity mask]:affinity mask (hexadecimal)' + '-stx-[exclude specified archive type]: :->archive-types' + '-t-[specify archive type]: :->archive-types' + '-u-[specify update options]:update options' # @todo complete these + '-v-[create volume of specified size]: :_numbers -u bytes "volume size" b k m g' + '-w-[use temporary work directory (or specify)]::work directory:_files -/' + '*-x-[specify files to exclude]: :->file-refs' + '-y[assume yes to all queries]' + '1:command:(( + a\:"add files to archive" + b\:"benchmark" + d\:"delete files from archive" + e\:"extract files from archive (without full paths)" + h\:"calculate hash values for files" + i\:"show information about supported formats" + l\:"list contents of archive" + rn\:"rename files in archive" + t\:"test integrity of archive" + u\:"update files in archive" + x\:"extract files (with full paths)" + ))' + '(-an)2:archive file:_files' + '*: :_files' # @todo complete more specifically, handle list files +) + +_arguments -S : $args && ret=0 + +case $state in + archive-types) + local -a formats=( "${(@f)"$( _call_program 7z-info $words[1] i )"}" ) + formats=( "${(@)formats[(r)*Formats:*,-1]}" ) + formats=( ${formats[2,(r)]} ) + + # 'C' appears in fourth column if compression is supported + [[ ${(L)words[(rn:2:)^-*]} == (a|d|rn|u) ]] && + formats=( ${(M)formats:#???C*} ) + + # new (?) format + if [[ -n ${(M)formats:#*....*} ]]; then + formats=( ${formats/#?(#c28)/} ) + # old/p7zip format + else + formats=( ${formats/#?(#c17)/} ) + fi + formats=( ${formats%%[[:space:]]*} ) + + (( $#formats )) || formats=( 7z bzip2 gzip tar xz zip ) + formats=( ${formats//:/\\:} ) + + # @todo also complete the various -t* and -t# modes + _describe \ + -t formats \ + 'archive type' \ + formats \ + -M 'm:{a-z}={A-Z}' \ + && ret=0 + ;; + + charsets-io) + _describe \ + -t charsets \ + 'character set' \ + '( UTF-8 WIN DOS )' \ + -M 'm:{a-z}={A-Z}' \ + && ret=0 + ;; + + charsets-listfile) + _describe \ + -t charsets \ + 'character set (or Windows code-page number)' \ + '( UTF-8 UTF-16LE UTF-16BE WIN DOS )' \ + -M 'm:{a-z}={A-Z}' \ + && ret=0 + ;; + + file-refs) + # @todo complete this properly + if compset -P 1 '*[@!]'; then + _files && ret=0 + else + _describe -t file-refs 'file-ref type' '( + "@:list file" + "!:file name or wildcard" + )' && ret=0 + fi + ;; + + hash-functions) + local -a hashers=( "${(@f)"$( _call_program 7z-info $words[1] i )"}" ) + hashers=( "${(@)hashers[(r)*Hashers:*,-1]}" ) + hashers=( ${hashers[2,(r)]} ) + hashers=( ${hashers##*[[:space:]]} ) + (( $#hashers )) || hashers=( CRC32 CRC64 SHA1 SHA256 BLAKE2sp ) + hashers+=( \* ) + hashers=( ${hashers//:/\\:} ) + _describe -t hashers 'hash function' hashers -M 'm:{a-z}={A-Z}' && ret=0 + ;; + + output-streams) + if compset -P '?'; then + _describe -t stream-dests 'output stream destination' '( + 0:disabled + 1:stdout + 2:stderr + )' && ret=0 + else + _describe -t stream-types 'output stream type' '( + "e:error messages" + "o:standard output messages" + "p:progress information" + )' && ret=0 + fi + ;; + + sfx-modules) + # sfx modules should be in the same directory as the 7zip executable. on + # some systems they live in some lib directory so we look there too + local -aU sfxes=( + ${${(Q)words[1]}:c:h}/*.sfx(#q.N:t) + ${${(Q)words[1]}:c:P:h}/*.sfx(#q.N:t) + {,/opt,/usr}{,/local}/lib/7zip/*.sfx(#q.N:t) + ) + _describe -t sfx-modules 'SFX modules' sfxes && ret=0 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index ab0cdee6c..554e61c49 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -50,11 +50,12 @@ case $service in args+=( '(-J --ask-vault-pass --ask-vault-password)'{-J,--ask-vault-pass{,word}}'[ask for vault password]' \*{-e+,--extra-vars=}'[set additional variables]:key=value, YAML/JSON or @file:->extra-vars' + '--flush-cache[clear fact cache for every host in inventory]' '*--vault-id=[specify vault identity to use]:vault identity' --vault-pass{,word}-file='[specify vault password file]:vault password file:_files' \*{-i+,--inventory=}'[specify inventory host file or host list]: : _alternative "files\:inventory file\:_files" "hosts\:host\: _sequence _hosts"' - '!(-i --inventory)--inventory-file=:inventory file:_files' + '!*--inventory-file=:inventory file:_files' '(-l --limit --host --graph)'{-l+,--limit=}'[further limit hosts to an additional pattern]:host subset:->hosts' ) ;| @@ -65,8 +66,8 @@ case $service in ;| ansible-playbook|ansible-pull) args+=( - \*{-t,--tags}'[only run plays and tasks tagged with these values]:tag:->tags' - "*--skip-tags[only run plays and tasks whose tags don't match]" + \*{-t,--tags=}'[only run plays and tasks tagged with these values]:tag:->tags' + "*--skip-tags=[only run plays and tasks whose tags don't match]:tag:->tags" ) ;| ansible-playbook|ansible-console) diff --git a/Completion/Unix/Command/_attr b/Completion/Unix/Command/_attr index efa7c5c4f..58fd8837e 100644 --- a/Completion/Unix/Command/_attr +++ b/Completion/Unix/Command/_attr @@ -2,11 +2,9 @@ case $service in attr) - local -a list - [[ $OSTYPE = irix* ]] && - list=( '(-g -s -r -V)-l[list extended attributes associated with file]' ) _arguments -s -S "$list[@]" \ '(-l -r -s -V)-g[get extended attribute for file]:attribute name' \ + '(-g -s -r -V)-l[list extended attributes associated with file]' \ '(-l -g -s -q -V)-r[remove given attribute from file]:attribute name' \ '(-l -g -r)-s[set named attribute for file]:attribute name' \ '(-r)-q[quiet output]' \ diff --git a/Completion/Unix/Command/_base64 b/Completion/Unix/Command/_base64 index bbf100acb..6309d8022 100644 --- a/Completion/Unix/Command/_base64 +++ b/Completion/Unix/Command/_base64 @@ -8,7 +8,12 @@ local variant type=base${service//[^2346]/} _pick_variant -r variant \ - gnu='(Free Soft|uutils)' fourmilab=fourmi darwin=-D unix --version + gnu='(Free Soft|uutils)' freebsd=FreeBSD netbsd='<wrap>' fourmilab=fourmi unix --version + +# as of macOS 13, Apple's base64 is based on FreeBSD's, and it reports that way, +# but it's moderately customised so that it supports roughly the same options as +# the base64 shell script they provided previously +[[ $variant == (freebsd|unix) && $OSTYPE == darwin* ]] && variant=darwin case $variant in gnu) @@ -27,17 +32,42 @@ case $variant in darwin) _arguments -s -S : \ '(: -)'{-h,--help}'[display help information]' \ + '(: -)--version[display version information]' \ + '(dec)' \ - '(enc)'{-D,--decode}"[decode input from $type]" \ + '(enc)'{-d,-D,--decode}"[decode input from $type]" \ + '(enc)' \ - '(dec)'{-b+,--break=}'[wrap encoded lines at specified number of columns]:number of columns' \ + '(dec)'{-b+,-w+,--break=,--wrap=}'[wrap encoded lines at specified number of columns]:number of columns' \ + '!(dec)--breaks=:number of columns' \ + '(out)' \ {-o+,--output=}'[specify output file]:output file:_files' \ + '(in)' \ - {-i+,--input=}'[specify input file]:input file:_files' \ + {-i+,--input=}'[specify input file]:input file:_files' + return + ;; + freebsd) + _arguments -s -S -A '-*' : \ + '(: -)--help[display help information]' \ + '(: -)--version[display version information]' \ + + dec \ + '(enc -d --decode)'{-d,--decode}"[decode input from $type]" \ + '!(enc)'{-i,--ignore-garbage} \ + + '(enc)' \ + '(dec)'{-w+,--wrap=}'[wrap encoded lines at specified number of columns]:number of columns' \ + + in \ '1:input file:_files' return ;; + netbsd) + _arguments -s -S -A '-*' : \ + + dec \ + '(enc -d -D)'{-d,-D}"[decode input from $type]" \ + '(enc)-i[ignore irrelevant characters when decoding]' \ + + '(enc)' \ + '(dec)'{-b+,-w+}'[wrap encoded lines at specified number of columns]:number of columns' \ + + in \ + '*:input file:_files' + return + ;; fourmilab) _arguments -s -S : \ '(: -)--copyright[display copyright information]' \ diff --git a/Completion/Unix/Command/_chdman b/Completion/Unix/Command/_chdman new file mode 100644 index 000000000..c1fea7d42 --- /dev/null +++ b/Completion/Unix/Command/_chdman @@ -0,0 +1,195 @@ +#compdef chdman + +local ret=1 words1=$words[1] +local -a opts args context state state_descr line expl +local -a create_common_opts extract_common_opts ld_common_opts +local -a meta_common_opts input_bytes_hunks_opts +local -A opt_args + +opts=( + '(--input -i)'{--input,-i}'[specify input file]:input file:_files' + '(--inputparent -ip)'{--inputparent,-ip}'[specify parent file for input CHD]:input parent file:_files' + '(--output -o)'{--output,-o}'[specify output file]:output file:_files' + '(--outputbin -ob)'{--outputbin,-ob}'[specify output file for binary data]:output binary file:_files' + '(--splitbin -sb)'{--splitbin,-sb}'[output one binary file per track]' + '(--force -f)'{--force,-f}'[overwrite existing file]' # note same short option as --fix + '(--outputparent -op)'{--outputparent,-op}'[specify parent file for output CHD]:output parent file:_files' + '(--inputstartbyte -isb)'{--inputstartbyte,-isb}'[specify starting byte offset within input]: :\ + _numbers -u bytes "start byte" k m g' + '(--inputstarthunk -ish)'{--inputstarthunk,-ish}'[specify starting hunk offset within input]: :\ + _numbers -u hunks "start hunk" k m g' + '(--inputstartframe -isf)'{--inputstartframe,-isf}'[specify starting frame within input]: :\ + _numbers -u frames "start frame" k m g' + '(--inputbytes -ib)'{--inputbytes,-ib}'[specify effective length of input in bytes]: :\ + _numbers -u bytes "input length" k m g' + '(--inputhunks -ih)'{--inputhunks,-ih}'[specify effective length of input in hunks]: :\ + _numbers -u hunks "input length" k m g' + '(--inputframes -if)'{--inputframes,-if}'[specify effective length of input in frames]: :\ + _numbers -u frames "input length" k m g' + '(--hunksize -hs)'{--hunksize,-hs}'[specify size of each hunk in bytes]: :\ + _numbers -u bytes -l 16 -m $((1024*1024)) "hunk size" k m g' + '(--unitsize -us)'{--unitsize,-us}'[specify size of each unit in bytes]: :\ + _numbers -u bytes "unit size" k m g' + '(--compression -c)'{--compression,-c}'[specify compression codecs to use]: :->codecs' + '(--ident -id)'{--ident,-id}'[specify ident file to provide CHS information]:ident file:_files' + '(--chs -chs)'{--chs,-chs}'[specify CHS information directly]:cylinders,heads,sectors:' + '(--sectorsize -ss)'{--sectorsize,-ss}'[specfiy size of each hard disk sector]: :\ + _numbers -u bytes "sector size" k m g' + '(--tag -t)'{--tag,-t}'[specify metadata tag]:4-character metadata tag:' + '(--index -ix)'{--index,-ix}'[specify indexed instance of metadata tag]:index:' + '(--valuetext -vt)'{--valuetext,-vt}'[specify metadata value as text]:metadata value:' + '(--valuefile -vf)'{--valuefile,-vf}'[specify file containing metadata value]:metadata value file:_files' + '(--numprocessors -np)'{--numprocessors,-np}'[specify max number of processors to use during compression]: :\ + _numbers -u processors -l1 "processor limit"' + '(--nochecksum -nocs)'{--nochecksum,-nocs}'[excluded added metadata from SHA-1]' + '(--fix -f)'{--fix,-f}'[fix SHA-1 if incorrect]' # note same short option as --force + '(--verbose -v)'{--verbose,-v}'[output additional information]' + '(--size -s)'{--size,-s}'[specify size of output file]: :\ + _numbers -u bytes "output file size" k m g' + '(--template -tp)'{--template,-tp}'[specify hard disk template]: :->templates' +) +create_common_opts=( + ${(M)opts:#(|*\))--(output|outputparent|force|input|hunksize|compression|numprocessors)\[*} + ${(M)opts:#(|*\))-(o|op|f|i|hs|c|np)\[*~*-f*fix*} +) +extract_common_opts=( + ${(M)opts:#(|*\))--(output|force|input|inputparent)\[*} + ${(M)opts:#(|*\))-(o|f|i|ip)\[*~*-f*fix*} +) +ld_common_opts=( + ${(M)opts:#(|*\))--(inputstartframe|inputframes)\[*} + ${(M)opts:#(|*\))-(isf|if)\[*} +) +meta_common_opts=( + ${(M)opts:#(|*\))--(input|tag|index)\[*} + ${(M)opts:#(|*\))-(i|t|ix)\[*} +) +input_bytes_hunks_opts=( + ${(M)opts:#(|*\))--(inputstartbyte|inputstarthunk|inputbytes|inputhunks)\[*} + ${(M)opts:#(|*\))-(isb|ish|ib|ih)\[*} +) + +if (( CURRENT < 3 )); then + args=( ': :->commands' ) +else + case $words[2] in + help) args=( ': :->commands' ) ;; + info) args=( + ${(M)opts:#(|*\))--(input|verbose)\[*} + ${(M)opts:#(|*\))-(i|v)\[*} + ) ;; + verify) args=( + ${(M)opts:#(|*\))--(input|inputparent)\[*} + ${(M)opts:#(|*\))-(i|ip)\[*} + ) ;; + createraw|createdvd) args=( + $create_common_opts + $input_bytes_hunks_opts + ${(M)opts:#(|*\))--(unitsize)\[*} + ${(M)opts:#(|*\))-(us)\[*} + ) ;; + createhd) args=( + $create_common_opts + $input_bytes_hunks_opts + ${(M)opts:#(|*\))--(unitsize|chs|sectorsize|template|ident)\[*} + ${(M)opts:#(|*\))-(us|chs|ss|tp|id)\[*} + ) ;; + createcd) args=( $create_common_opts ) ;; + createld) args=( $create_common_opts $ld_common_opts ) ;; + extractraw|extractdvd|extracthd) args=( + $extract_common_opts + $input_bytes_hunks_opts + ) ;; + extractcd) args=( + $extract_common_opts + ${(M)opts:#(|*\))--(outputbin)\[*} + ${(M)opts:#(|*\))-(ob)\[*} + ) ;; + extractld) args=( $extract_common_opts $ld_common_opts ) ;; + copy) args=( + $create_common_opts + $input_bytes_hunks_opts + ${(M)opts:#(|*\))--(inputparent)\[*} + ${(M)opts:#(|*\))-(ip)\[*} + ) ;; + addmeta) args=( + $meta_common_opts + ${(M)opts:#(|*\))--(valuetext|valuefile|nochecksum)\[*} + ${(M)opts:#(|*\))-(vt|vf|nocs)\[*} + ) ;; + delmeta) args=( $meta_common_opts ) ;; + dumpmeta) args=( + $meta_common_opts + ${(M)opts:#(|*\))--(output|force)\[*} + ${(M)opts:#(|*\))-(o|f)\[*~*-f*fix*} + ) ;; + esac + shift words + (( CURRENT-- )) +fi + +_arguments : $args && ret=0 + +case $state in + commands) + _describe -t commands command '( + "help:display usage information" + "info:display CHD information" + "verify:verify CHD integrity" + "createraw:create raw CHD" + "createhd:create hard disk CHD" + "createcd:create CD CHD" + "createdvd:create DVD CHD" + "createld:create LaserDisc CHD" + "extractraw:extract raw file from CHD" + "extracthd:extract hard disk file from CHD" + "extractcd:extract CD file from CHD" + "extractdvd:extract DVD file from CHD" + "extractld:extract LaserDisc AVI from CHD" + "copy:copy data from one CHD to another" + "addmeta:add metadata to CHD" + "delmeta:remove metadata from CHD" + "dumpmeta:dump metadata from CHD" + "listtemplates:list hard disk templates" + )' && ret=0 + ;; + + codecs) + local -a codecs + + case $words[1] in # was $words[2] + *ld) codecs=( + 'avhu[A/V Huffman]' + ) ;; + *cd) codecs=( + 'cdfl[CD FLAC]' 'cdlz[CD LZMA]' 'cdzl[CD Deflate]' 'cdzs[CD Zstandard]' + ) ;; + *) codecs=( + 'flac[FLAC]' 'huff[Huffman]' 'lzma[LZMA]' 'zlib[Deflate]' 'zstd[Zstandard]' + ) ;; + esac + + _alternative \ + 'codecs-none:no codec:(( none\:uncompressed ))' \ + "codecs: :_values -s, 'compression codec' ${(j< >)${(@q+)codecs}}" \ + && ret=0 + ;; + + templates) + local -a tpls tmp=( ${(f)"$( + _call_program templates $words1 listtemplates + )"} ) + tmp=( ${(@)${(@)tmp//[[:space:]]##/ }# } ) + tmp=( ${(@M)tmp:#<-> *} ) + + for 1 in $tmp; do + tmp=( ${(z)1} ) + # id : mfg model (c,h,s) + tpls+=( "${tmp[1]}:$tmp[2] $tmp[3] (${(j<,>)${(@)tmp[4,6]}})" ) + done + + _describe -2V -t templates 'hard disk template' tpls && ret=0 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index dae0de86c..36db9c4d2 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -74,19 +74,13 @@ _arguments -C -s -S -0 $aopts "$args[@]" '*: :->files' && ret=0 case $state in owner) - if [[ $service = chgrp ]] || compset -P '*[:.]'; then + if [[ $service = chgrp ]] || compset -P '*:'; then if (( EGID && $+commands[groups] && ! $+_comp_priv_prefix )); then # except for sudo _wanted groups expl 'group' compadd -- $(groups) && return 0 fi _groups && ret=0 else - if compset -S '[.:]*'; then - suf=() - elif [[ $OSTYPE = irix* ]]; then - suf=( -qS '.' ) - else - suf=( -qS ':' ) - fi + compset -S ':*' || suf=( -qS: ) _users "$suf[@]" && ret=0 fi ;; @@ -102,9 +96,9 @@ case $state in if [[ $service = chgrp ]]; then grp=${line[1]} else - usr=${line[1]%%[.:]*} + usr=${line[1]%%:*} usr=${${(M)usr:#[0-9]#}:-${userdirs[$usr]:+.$usr.}} - grp=${${(M)line[1]%%[.:]*}#?} + grp=${${(M)line[1]%%:*}#?} fi [[ -n $grp ]] && grp="${${(M)grp:#[0-9]#}:-.$grp.}" req=( ${usr:+\^u$usr} ${grp:+\^g$grp} ) diff --git a/Completion/Unix/Command/_column b/Completion/Unix/Command/_column index 687d7620f..737bb4561 100644 --- a/Completion/Unix/Command/_column +++ b/Completion/Unix/Command/_column @@ -18,6 +18,12 @@ _pick_variant -r variant \ --version case $variant in + freebsd*) + args=( + '-l+[specify maximum number of input columns]:columns' + ) + ;| + util-linux) aopts=() args=( diff --git a/Completion/Unix/Command/_cpio b/Completion/Unix/Command/_cpio index 20f8c712d..6db4994d8 100644 --- a/Completion/Unix/Command/_cpio +++ b/Completion/Unix/Command/_cpio @@ -120,13 +120,12 @@ if [[ $state = afile ]]; then 'users:user name:_users -qS@' && ret=0 fi elif [[ $state = user ]]; then - if compset -P '*[:.]'; then + if compset -P '*:'; then _groups && ret=0 else - local suf=. - [[ $OSTYPE = (solaris|hpux)* ]] && suf=: - compset -S '.*' && unset suf - _users -S "$suf" -q && ret=0 + local suf + compset -S ':*' || suf=( -qS: ) + _users $suf && ret=0 fi fi diff --git a/Completion/Unix/Command/_darcs b/Completion/Unix/Command/_darcs deleted file mode 100644 index 74734711d..000000000 --- a/Completion/Unix/Command/_darcs +++ /dev/null @@ -1,38 +0,0 @@ -#compdef darcs -## Darcs completion snippet for zsh. -## -## Copyright (C) 2009 Nicolas Pouillard -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -local expl - -if (($CURRENT == 2)); then - # We're completing the first word after "darcs" -- the command. - _wanted command expl 'darcs command' \ - compadd -- $( darcs --commands ) -else - case "${words[$CURRENT]}"; in - # If it looks like an URL... - ht*|ft*) - _arguments '*:URL:_urls' - ;; - # If it looks like an explicit path... - /*|./*|\~*|../*) - _arguments '*:file:_files' - ;; - # Otherwise, let's ask darcs for all possible options - *) - _wanted args expl 'arg for darcs command' \ - compadd -- $( darcs ${words[2]} --list-option ) - ;; - esac -fi diff --git a/Completion/Unix/Command/_df b/Completion/Unix/Command/_df index dae833dfa..ebfe96186 100644 --- a/Completion/Unix/Command/_df +++ b/Completion/Unix/Command/_df @@ -88,7 +88,7 @@ elif [[ "$OSTYPE" == (darwin|dragonfly|freebsd|netbsd*|openbsd)* ]]; then '(-P -G -N)-f[display only the available free]' '(-G -i -P)-G[display all fields in statvfs]' '(-G -P)-N[suppress the header line normally output]' - '-W[print widge name instead of the device]' + '-W[print wedge name instead of the device]' ) ;; esac diff --git a/Completion/Unix/Command/_diffstat b/Completion/Unix/Command/_diffstat index 9e7bf779b..068ec4c1e 100644 --- a/Completion/Unix/Command/_diffstat +++ b/Completion/Unix/Command/_diffstat @@ -17,6 +17,7 @@ _arguments -s -S \ '-n+[specify minimum width for filenames]:width [auto]' \ '-N+[specify maximum width for filenames]:width [auto]' \ '-o+[redirect standard output to specified file]:output file:_files' \ + '-O[inspect only files listed in diff for -S/-D options]' \ '-p+[specify number of path separators to strip]:path components [common]' \ '-q[suppress "0 files changed" message for empty diffs]' \ '-r+[specify rounding for histogram]:rounding:((0\:none 1\:simple 2\:simple+adjustment))' \ diff --git a/Completion/Unix/Command/_dig b/Completion/Unix/Command/_dig index 440c5de90..893f187d6 100644 --- a/Completion/Unix/Command/_dig +++ b/Completion/Unix/Command/_dig @@ -17,15 +17,16 @@ local -a alts args '*+'{no,}'badcookie[retry BADCOOKIE responses]' '*+'{no,}'cdflag[set the CD (checking disabled) bit in the query]' '*+'{no,}'class[display the CLASS whening printing the record]' + '*+'{no,}'coflag[set compact denial of existence ok flag in query]' '*+'{no,}'cookie[add a COOKIE option to the request]' '*+'{no,}'crypto[display cryptographic fields in DNSSEC records]' '*+'{no,}'dns64prefix[get the DNS64 prefixes from ipv4only.arpa]' - '*+edns=-[specify EDNS version for query]:version (0-255)' + '*+edns=-[specify EDNS version for query]:version (0-255) [0]' '*+noedns[clear EDNS version to be sent]' - '*+ednsflags=-[set EDNS flags bits]:flags' + '*+ednsflags=-[set undefined EDNS flags bits]:flags' '*+'{no,}'ednsnegotiation[set EDNS version negotiation]' '*+ednsopt=-[specify EDNS option]:code point' - '*+noedns[clear EDNS options to be sent]' + '*+noednsopt[clear EDNS options to be sent]' '*+'{no,}'expandaaaa[expand AAAA records]' '*+'{no,}'expire[send an EDNS Expire option]' '*+'{no,}'header-only[send query without a question section]' @@ -45,6 +46,7 @@ local -a alts args '*+'{no,}'cmd[print initial comment in output]' '*+'{no,}'short[print terse output]' '*+'{no,}'showbadcookie[show BADCOOKIE message]' + '*+'{no,}'showbadvers[show BADVERS message]' '*+'{no,}'identify[print IP and port of responder]' '*+'{no,}'comments[print comment lines in output]' '*+'{no,}'stats[print statistics]' diff --git a/Completion/Unix/Command/_echo b/Completion/Unix/Command/_echo new file mode 100644 index 000000000..e835847c2 --- /dev/null +++ b/Completion/Unix/Command/_echo @@ -0,0 +1,32 @@ +#compdef echo gecho + +local variant +local -a args + +_pick_variant -r variant -b zsh gnu='Free Soft' $OSTYPE --version + +args=( + # these are only interpreted as options when they're the only arg + + gnu-hv + '(-)--help[display help information]' + '(-)--version[display version information]' + + other + '(gnu-hv -E)-e[interpret escape sequences]' + "(gnu-hv -e)-E[don't interpret escape sequences]" + "(gnu-hv)-n[don't output trailing newline]" +) + +case $variant in + gnu) ;; # pass + zsh|openbsd*) + args=( ${args:#(|\(*\))--*} ) + ;; + darwin*|dragonfly*|netbsd*|freebsd*) + args=( ${args:#(|\(*\))(--|-[eE]\[)*} ) + ;; + *) + args=( ) + ;; +esac + +_arguments -s -A '' : $args '*:string:_default' diff --git a/Completion/Unix/Command/_entr b/Completion/Unix/Command/_entr index 438ab179a..4fb984af2 100644 --- a/Completion/Unix/Command/_entr +++ b/Completion/Unix/Command/_entr @@ -11,6 +11,7 @@ _arguments -s -S \ '-p[postpone first execution of the utility]' \ '(-a)-r[reload a persistent child process]' \ '(*)-s[evaluate the first argument using interpreter specified by $SHELL]' \ + '*-x[format custom exit status messages using a persistent awk(1) process]' \ '-z[exit after the utility completes]' \ '(-): :->command' \ '*::arguments:_normal' && ret=0 diff --git a/Completion/Unix/Command/_env b/Completion/Unix/Command/_env index b9094339e..6173394e0 100644 --- a/Completion/Unix/Command/_env +++ b/Completion/Unix/Command/_env @@ -69,7 +69,9 @@ if [[ -n $state ]]; then shift words (( CURRENT-- )) done - _normal -p env && ret=0 + _alternative \ + 'parameters:environment variable:_parameters -g "*export*" -qS=' \ + 'normal:: _normal -p env' && ret=0 ;; user-class) if compset -P 1 '*/'; then diff --git a/Completion/Unix/Command/_ffmpeg b/Completion/Unix/Command/_ffmpeg index e5afdac4f..9c91fe386 100644 --- a/Completion/Unix/Command/_ffmpeg +++ b/Completion/Unix/Command/_ffmpeg @@ -23,8 +23,8 @@ typeset -A opt_args (( $+functions[_ffmpeg_scodecs] )) || _ffmpeg_scodecs() { local scodecs - scodecs=(copy ${${(M)${(f)"$(_call_program video-codecs $words[1] -codecs 2>/dev/null)"}:#[[:space:]][D[:space:]][E[:space:]]S[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:space:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]}) - _wanted ffmpeg-video-codecs expl 'force video codec (''copy'' to copy stream)' compadd -a scodecs + scodecs=(copy ${${(M)${(f)"$(_call_program subtitle-codecs $words[1] -codecs 2>/dev/null)"}:#[[:space:]][D[:space:]][E[:space:]]S[S[:space:]][D[:space:]][T[:space:]][[:space:]][^[:space:]]##*}//(#b)????????([^[:space:]]##)*/$match[1]}) + _wanted ffmpeg-subtitle-codecs expl 'force subtitle codec (''copy'' to copy stream)' compadd -a scodecs } (( $+functions[_ffmpeg_formats] )) || _ffmpeg_formats() { diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 4908cabbc..8628ad43e 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -162,7 +162,7 @@ if [[ $state = times ]]; then zstyle -s ":completion:${curcontext}:senses" list-separator sep || sep=-- default=" [default exactly]" disp=( "+ $sep before (older files)" "- $sep since (newer files)" ) - smatch=( - + ) + smatch=( + - ) else disp=( before exactly since ) smatch=( + '' - ) diff --git a/Completion/Unix/Command/_fish b/Completion/Unix/Command/_fish new file mode 100644 index 000000000..08541bc83 --- /dev/null +++ b/Completion/Unix/Command/_fish @@ -0,0 +1,78 @@ +#compdef fish + +local MATCH MBEGIN MEND ret=1 +local -a args context line state state_descr +local -A opt_args + +args=( + # unlike most shells, fish's -c is a normal option-with-optarg which can be + # interleaved with other options and can even be given multiple times. + # obviously we can't complete command strings reliably here but we'll try + '(1)*'{-c+,--command=}'[execute specified command string]: :_cmdstring' + '*'{-C+,--init-command=}'[execute specified command before other input]: :_cmdstring' + '(-d --debug)'{-d+,--debug=}'[enable debug output for specified categories]: :->debug' + '(-o --debug-output)'{-o+,--debug-output=}'[specify debug output file]:debug output file:_files' + '(-f --features)'{-f+,--features=}'[enable specified feature flags]: :->feature' + '(-i --interactive)'{-i,--interactive}'[act as interactive shell]' + '(-l --login)'{-l,--login}'[act as login shell]' + '(-N --no-config)'{-N,--no-config}'[do not read configuration files]' + '(-n --no-execute)'{-n,--no-execute}'[check syntax only (do not execute commands)]' + '(-p --profile)'{-p+,--profile=}'[specify profile output file]:profile output file:_files' + '--profile-startup=[specify start-up profile output file]:profile output file:_files' + '(-P --private)'{-P,--private}'[enable private mode (no history)]' + '--print-rusage-self[output getrusage() stats on exit]' + '(- : *)--print-debug-categories[display debug categories]' + '(- : *)'{-v,--version}'[display version information]' + '(- : *)'{-h,--help}'[display usage information]' + '(-)1:script file:_files' + '(-)*:argument:_files' +) + +_arguments -s -S -A '-*' : $args && ret=0 + +case $state in + debug) + local -a tmp=( ${(f)"$( + _call_program debug-categories $words[1] --print-debug-categories + )"} ) + tmp=( ${${tmp/[[:space:]]##/\[}/%/\]} ) + tmp=( ${tmp/(#m)\[[A-Z][^A-Z]/${(L)MATCH}} ) + tmp=( ${tmp/.\]/\]} ) + _values -s, 'debug category' $tmp && ret=0 + ;; + + feature) + local name def ver desc + local -a flags_on flags_off versions flags tmp + + while IFS=$'\t ' read -r name def ver desc; do + desc=${${desc/#(#m)[A-Z][^A-Z]/${(L)MATCH}}//(#m)[]\\]/\\$MATCH} + if [[ $def == on ]]; then + flags_on+=( $name"[$desc ($ver, defaults on)]" ) + else + flags_off+=( $name"[$desc ($ver, defaults off)]" ) + fi + versions+=( $ver"[all features introduced in fish $ver]" ) + done < <( + _call_program feature-flags $words[1] -NPc '"status features"' + ) + + # if an individual flag is already on, show the no- variant, and vice versa + flags+=( no-$^flags_on $flags_off ) + # always show both for these 'groups' + flags+=( {no-,}all'[all features]' {no-,}${(u)versions} ) + + # only show redundant variants of individual flags when necessary + tmp=( no-$^flags_off ) + [[ ${PREFIX##*,} == n* ]] || tmp=( '!'$^tmp ) + flags+=( $tmp ) + + tmp=( ${(M)flags_on:#${${PREFIX##*,}[1]:----}*} ) + (( $#tmp )) || tmp=( '!'$^flags_on ) + flags+=( $tmp ) + + _values -s, 'feature flag' $flags && ret=0 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index d81f31cf5..03c3eb2f2 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -158,7 +158,7 @@ mips*) '-mginv[ginv]' '-mgpopt[use GP relative accesses for symbols known to be in a small data section]' '-mindirect-jump=[change indirect jump instructions to inhibit speculation]:arg' - '-mips16[ips16]' + '-mips16[mips16]' '-mldc1-sdc1[ldc1 sdc1]' '-mlocal-sdata[extend the -G behaviour to object local data]' '-mmadd4[enable the generation of 4-operand madd.s, madd.d, etc]' @@ -212,20 +212,20 @@ i[3456]86|x86_64) '-mavx256-split-unaligned-load[split 32-byte AVX unaligned load]' '-mavx256-split-unaligned-store[split 32-byte AVX unaligned store]' '-mavx2[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and AVX2 built-in functions and code generation]' - '-mavx5124fmaps[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124FMAPS built- in functions and code generation]' - '-mavx5124vnniw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124VNNIW built- in functions and code generation]' + '-mavx5124fmaps[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124FMAPS built-in functions and code generation]' + '-mavx5124vnniw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX5124VNNIW built-in functions and code generation]' '-mavx512bf16[avx512bf16]' '-mavx512bitalg[avx512bitalg]' - '-mavx512bw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512BW built- in functions and code generation]' - '-mavx512cd[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512CD built- in functions and code generation]' - '-mavx512dq[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512DQ built- in functions and code generation]' - '-mavx512er[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512ER built- in functions and code generation]' + '-mavx512bw[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512BW built-in functions and code generation]' + '-mavx512cd[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512CD built-in functions and code generation]' + '-mavx512dq[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512DQ built-in functions and code generation]' + '-mavx512er[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512ER built-in functions and code generation]' '-mavx512f[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F built-in functions and code generation]' '-mavx512ifma[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512IFMA built-in functions and code generation]' - '-mavx512pf[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512PF built- in functions and code generation]' + '-mavx512pf[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512PF built-in functions and code generation]' '-mavx512vbmi2[avx512vbmi2]' '-mavx512vbmi[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VBMI built-in functions and code generation]' - '-mavx512vl[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VL built- in functions and code generation]' + '-mavx512vl[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX512F and AVX512VL built-in functions and code generation]' '-mavx512vnni[avx512vnni]' '-mavx512vp2intersect[avx512vp2intersect]' '-mavx512vpopcntdq[support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and AVX512VPOPCNTDQ built-in functions and code generation]' @@ -469,7 +469,7 @@ webassembly*) '-mexception-handling[exception handling]' '-mmultivalue[multivalue]' '-mmutable-globals[mutable globals]' - '-mnontrapping-fptoint[no ntrapping fptoint]' + '-mnontrapping-fptoint[nontrapping float-to-int conversion]' '-mreference-types[reference types]' '-msign-ext[sign ext]' '-msimd128[simd128]' @@ -528,11 +528,11 @@ if [[ "$service" = clang* ]]; then '-cpp[cpp]' '--cuda-compile-host-device[compile CUDA code for both host and device]' '--cuda-device-only[compile CUDA code for device only]' - '--cuda-gpu-arch=[cUDA offloading device architecture]:arg' + '--cuda-gpu-arch=[CUDA offloading device architecture]:arg' '--cuda-host-only[compile CUDA code for host only]' '*--cuda-include-ptx=[include ptx for the following gpu architecture]:argument' '--cuda-noopt-device-debug[enable device-side debug info generation]' - '--cuda-path=[cUDA installation path]:arg' + '--cuda-path=[CUDA installation path]:arg' '--cuda-path-ignore-env[ignore environment variables to detect CUDA installation]' '-cuid=[an id for compilation unit]:argument' '-current_version[current version]:current version' @@ -577,9 +577,9 @@ if [[ "$service" = clang* ]]; then '-fapplication-extension[restrict code to those available for App Extensions]' '-fasm-blocks[asm blocks]' '-fassume-sane-operator-new[assume sane operator new]' - '-fast[ast]' - '-fastcp[astcp]' - '-fastf[astf]' + '-fast[fast]' + '-fastcp[fastcp]' + '-fastf[fastf]' '-fautolink[autolink]' '-fautomatic[automatic]' '-fauto-profile-accurate[auto profile accurate]' @@ -654,7 +654,7 @@ if [[ "$service" = clang* ]]; then '-fdenormal-fp-math=[denormal fp math]:arg' '-fdepfile-entry=[depfile entry]:arg' '-fdiagnostics-absolute-paths[print absolute paths in diagnostics]' - '-fdiagnostics-fixit-info[supply fixit into with diagnostic messages]' + '-fdiagnostics-fixit-info[supply fixit info with diagnostic messages]' '-fdiagnostics-format=[diagnostics format]:arg' '-fdiagnostics-hotness-threshold=[prevent optimization remarks from being output if they do not meet threshold]:value' '-fdiagnostics-parseable-fixits[print fixits in a machine parseable form]' @@ -721,12 +721,12 @@ if [[ "$service" = clang* ]]; then '-fgpu-rdc[generate relocatable device code, also known as separate compilation mode]' '-fgpu-sanitize[enable sanitizer for AMDGPU target]' '-fheinous-gnu-extensions[heinous GNU extensions]' - '-fhip-new-launch-api,[-fno-hip-new-launch-api Use new kernel launching API for HIP]' + '-fhip-new-launch-api[Use new kernel launching API for HIP]' '-fhonor-infinites[honor infinites]' '-fhonor-infinities[honor infinities]' '-fhonor-nans[honor nans]' '-fignore-exceptions[enable support for ignoring exception handling constructs]' - '-filelist[ilelist]:arg' + '-filelist[filelist]:arg' '-fimplicit-module-maps[implicit module maps]' '-fimplicit-modules[implicit modules]' '-fimplicit-none[no implicit typing allowed unless overridden by IMPLICIT statements]' @@ -931,7 +931,6 @@ if [[ "$service" = clang* ]]; then '-fsymbol-partition=[symbol partition]:arg' '-fsystem-module[build this module as a system module. only used with -emit-module]' '-ftemplate-backtrace-limit=[template backtrace limit]:arg' - '-ftemplate-depth--[template depth]:arg' '-ftemplate-depth=[template depth]:arg' '-fterminated-vtables[terminated vtables]' '-fthin-link-bitcode=[write minimized bitcode to <file>]:file:_files' @@ -1016,7 +1015,7 @@ if [[ "$service" = clang* ]]; then '-headerpad_max_install_names[headerpad max install names]:argument' '-help[display this information]' '--help-hidden[display help for hidden options]' - '--hip-device-lib=[hIP device library]:arg' + '--hip-device-lib=[HIP device library]:arg' '--hip-device-lib-path=[hip device lib path]:arg' '--hip-link[link clang-offload-bundler bundles for HIP]' '--hip-version=[HIP version in the format of major.minor.patch]' @@ -1089,7 +1088,7 @@ if [[ "$service" = clang* ]]; then '-mmacosx-version-min=[macosx version min]:arg' '-mmcu=[mcu]:arg' '-module-dependency-dir[directory to dump module dependencies to]:arg' - '-module-dir[odule dir]:dir' + '-module-dir[module dir]:dir' '-module-file-info[provide information about a particular module file]' '-moslib=[oslib]:arg' '-moutline-atomics[generate local calls to out-of-line atomic operations]' @@ -1225,13 +1224,13 @@ if [[ "$service" = clang* ]]; then '--resource=[resource]:arg' '-rewrite-legacy-objc[rewrite Legacy Objective-C source to C++]' '-rewrite-objc[rewrite Objective-C source to C++]' - '--rocm-device-lib-path=[rOCm device library path]:arg' - '--rocm-path=[rOCm installation path]:arg' + '--rocm-device-lib-path=[ROCm device library path]:arg' + '--rocm-path=[ROCm installation path]:arg' '-Rpass-analysis=[report transformation analysis from optimization passes]:regex' '-Rpass-missed=[report missed transformations by optimization passes]:arg' '-Rpass=[report transformations performed by optimization passes]:arg' '-rpath[rpath]:arg' - '-r[product a relocatable object as output]' + '-r[produce a relocatable object as output]' '--rtlib=[compiler runtime library to use]:arg' '-rtlib=[rtlib]:arg' '--save-stats=[save llvm statistics]:arg' @@ -1247,7 +1246,6 @@ if [[ "$service" = clang* ]]; then '-seglinkedit[seglinkedit]' '-segprot[segprot]:arg' '-segs_read_only_addr[segs read only addr]:arg' - '-segs_read_[segs read]:arg' '-segs_read_write_addr[segs read write addr]:arg' '--serialize-diagnostics[serialize compiler diagnostics to a file]:arg' '-serialize-diagnostics[serialize diagnostics]:arg' @@ -1302,9 +1300,9 @@ if [[ "$service" = clang* ]]; then '-Xarch_host[pass arg to CUDA/HIP host compilation]:argument' '-Xclang[pass <arg> to the clang compiler]:arg' '-Xcuda-fatbinary[pass arg to fatbinary invocation]:argument' - '-Xcuda-ptxas[pass arg to the ptxas assemler]:argument' + '-Xcuda-ptxas[pass arg to the ptxas assembler]:argument' '-Xflang[pass <arg> to the flang compiler]:arg' - '-Xopenmp-target[pass arg to the the target offloading toolchain]:argument' + '-Xopenmp-target[pass arg to the target offloading toolchain]:argument' '-y[the action to perform on the input]:arg' '-Z-[undocumented option]:argument' ) @@ -1390,7 +1388,7 @@ warnings+=( '-Wdate-time[warn about __TIME__, __DATE__ and __TIMESTAMP__ usage]' '-Wdeclaration-after-statement[warn when a declaration is found after a statement]' '-Wdelete-incomplete[warn when deleting a pointer to incomplete type]' - '-Wdelete-non-virtual-dtor[warn about deleting polymorphic objects with non- virtual destructors]' + '-Wdelete-non-virtual-dtor[warn about deleting polymorphic objects with non-virtual destructors]' '-Wdeprecated-declarations[warn about uses of __attribute__((deprecated)) declarations]' '-Wdeprecated[warn if a deprecated compiler feature, class, method, or field is used]' '-Wdesignated-init[warn about positional initialization of structs requiring designated initializers]' @@ -1418,7 +1416,7 @@ warnings+=( '-Wformat-overflow=[warn about function calls with format strings that write past the end of the destination region]:level:(1 2)' '-Wformat-security[warn about possible security problems with format functions]' '-Wformat-signedness[warn about sign differences with format functions]' - '-Wformat-truncation[warn about calls to snprintf and similar functions that truncate output. Same as -Wformat- truncation=1. Same as -Wformat-truncation=]' + '-Wformat-truncation[warn about calls to snprintf and similar functions that truncate output]' '-Wformat-truncation=[warn about calls to snprintf and similar functions that truncate output]:level:(1 2)' '-Wformat=[warn about printf/scanf/strftime/strfmon format string anomalies]::level:(1 2)' '-Wformat-y2k[warn about strftime formats yielding 2-digit years]' @@ -1516,7 +1514,7 @@ warnings+=( '-Wredundant-decls[warn about multiple declarations of the same object]' '-Wregister[warn about uses of register storage specifier]' '-Wreorder[warn when the compiler reorders code]' - '-Wrestrict[warn when an argument passed to a restrict- qualified parameter aliases with another argument]' + '-Wrestrict[warn when an argument passed to a restrict-qualified parameter aliases with another argument]' '-Wreturn-local-addr[warn about returning a pointer/reference to a local or temporary variable]' '-Wreturn-type[warn whenever a function'\''s return type defaults to "int" (C), or about inconsistent return types (C++)]' '-Wscalar-storage-order[warn on suspicious constructs involving reverse scalar storage order]' @@ -1553,7 +1551,7 @@ warnings+=( '-Wsuggest-override[suggest that the override keyword be used when the declaration of a virtual function overrides another]' '-Wsurprising[warn about "suspicious" constructs]' '-Wswitch-bool[warn about switches with boolean controlling expression]' - '-Wswitch-default[warn about enumerated switches missing a "default-" statement]' + '-Wswitch-default[warn about enumerated switches missing a "default" statement]' '-Wswitch-enum[warn about all enumerated switches missing a specific case]' '-Wswitch-unreachable[warn about statements between switch'\''s controlling expression and the first case]' '-Wswitch[warn about enumerated switches, with no default, missing a case]' @@ -1584,7 +1582,7 @@ warnings+=( '-Wunused-const-variable[warn when a const variable is unused. Same as -Wunused-const-variable=]' '-Wunused-const-variable=[warn when a const variable is unused]:level:(1 2)' '-Wunused-dummy-argument[warn about unused dummy arguments]' - '-Wunused[enable all -Wunused- warnings]' + '-Wunused[enable all -Wunused-warnings]' '-Wunused-function[warn when a function is unused]' '-Wunused-label[warn when a label is unused]' '-Wunused-local-typedefs[warn when typedefs locally defined in a function are not used]' @@ -1750,7 +1748,7 @@ args+=( '-ffat-lto-objects[output lto objects containing both the intermediate language and binary output]' '-ffinite-math-only[assume no NaNs or infinities are generated]' '-ffixed--[mark <register> as being unavailable to the compiler]:register' - '-ffloat-store[don'\''t allocate floats and doubles in extended- precision registers]' + '-ffloat-store[don'\''t allocate floats and doubles in extended-precision registers]' '-fforward-propagate[perform a forward propagation pass on RTL]' '-ffp-contract=-[perform floating-point expression contraction]:style [fast]:(on off fast)' '-ffp-int-builtin-inexact[allow built-in functions ceil, floor, round, trunc to raise "inexact" exceptions]' @@ -1800,7 +1798,6 @@ args+=( '-fira-hoist-pressure[use IRA based register pressure calculation in RTL hoist optimizations]' '-fira-loop-pressure[use IRA based register pressure calculation in RTL loop optimizations]' '-fira-region=-[set regions for IRA]:region:(all mixed one)' - '-fira-region=[set regions for IRA]:region:(one all mixed)' '-fira-share-save-slots[share slots for saving different hard registers]' '-fira-share-spill-slots[share stack slots for spilled pseudo-registers]' '-fira-verbose=-[control IRA'\''s level of diagnostic messages]:verbosity: ' @@ -1862,7 +1859,7 @@ args+=( '-fPIE[generate position-independent code for executables if possible (large mode)]' '-fpie[generate position-independent code for executables if possible (small mode)]' '-fplan9-extensions[enable Plan 9 language extensions]' - '-fplt[use PLT for PIC calls (-fno-plt- load the address from GOT at call site)]' + '-fplt[use PLT for PIC calls (-fno-plt-load the address from GOT at call site)]' '-fplugin-arg--[specify argument <key>=<value> for plugin <name>]:-fplugin-arg-name-key=value: ' #TODO '-fplugin=-[specify a plugin to load]:plugin: ' # TODO: complete plugins? '-fpost-ipa-mem-report[report on memory allocation before interprocedural optimization]' @@ -1907,11 +1904,7 @@ args+=( '-fsched-spec-insn-heuristic[enable the speculative instruction heuristic in the scheduler]' '-fsched-spec-load[allow speculative motion of some loads]' '-fsched-spec-load-dangerous[allow speculative motion of more loads]' - '-fsched-stalled-insns[allow premature scheduling of queued insns]' - '-fsched-stalled-insns-dep[set dependence distance checking in premature scheduling of queued insns]' - '-fsched-stalled-insns-dep=[set dependence distance checking in premature scheduling of queued insns]:insns:' '-fsched-stalled-insns-dep=-[set dependence distance checking in premature scheduling of queued insns]:instructions: ' - '-fsched-stalled-insns=[set number of queued insns that can be prematurely scheduled]:insns:' '-fsched-stalled-insns=-[set number of queued insns that can be prematurely scheduled]:instructions: ' '-fschedule-fusion[perform a target dependent instruction fusion optimization pass]' '-fschedule-insns2[reschedule instructions after register allocation]' @@ -1942,14 +1935,13 @@ args+=( '-fsplit-wide-types[split wide types into independent registers]' '-fssa-backprop[enable backward propagation of use properties at the SSA level]' '-fssa-phiopt[optimize conditional patterns using SSA PHI nodes]' - '-fstack-check=-[insert stack checking code into the program. -fstack-check=specific if to argument given]:type:(none generic specific)' + '-fstack-check=-[insert stack checking code into the program]:type:(none generic specific)' '-fstack-limit-register=-[trap if the stack goes past <register>]:register: ' '-fstack-limit-symbol=-[trap if the stack goes past symbol <name>]:name: ' '-fstack-protector-all[use a stack protection method for every function]' '-fstack-protector-explicit[use stack protection method only for functions with the stack_protect attribute]' '-fstack-protector-strong[use a smart stack protection method for certain functions]' '-fstack-protector[use propolice as a stack protection method]' - '-fstack-reuse=[set stack reuse level for local variables]:level:(all named_vars none)' '-fstack-reuse=-[set stack reuse level for local variables]:reuse-level:(all named_vars none)' '-fstack-usage[output stack usage information on a per-function basis]' '-fstdarg-opt[optimize amount of stdarg registers saved to stack at start of function]' @@ -1989,10 +1981,9 @@ args+=( '-ftree-loop-linear[enable loop interchange transforms. Same as -floop-interchange]' '-ftree-loop-optimize[enable loop optimizations on tree level]' '-ftree-loop-vectorize[enable loop vectorization on trees]' - '-ftree-lrs[perform live range splitting during the SSA- >normal pass]' - '-ftree-parallelize-loops=[enable automatic parallelization of loops]' + '-ftree-lrs[perform live range splitting during the SSA->normal pass]' '-ftree-parallelize-loops=-[enable automatic parallelization of loops]:threads: ' - '-ftree-partial-pre[in SSA-PRE optimization on trees, enable partial- partial redundancy elimination]' + '-ftree-partial-pre[in SSA-PRE optimization on trees, enable partial-partial redundancy elimination]' '-ftree-phiprop[enable hoisting loads from conditional pointers]' '-ftree-pre[enable SSA-PRE optimization on trees]' '-ftree-pta[perform function-local points-to analysis on trees]' @@ -2083,7 +2074,7 @@ args+=( '(-pg)-p[enable function profiling for prof]' '-pie[create a position independent executable]' {-pipe,--pipe}'[use pipes rather than intermediate files]' - {-P,--no-line-commands}'[inhibit generation of linkemakers during preprocess]' + {-P,--no-line-commands}'[inhibit generation of linemarkers during preprocess]' '(-p)-pg[enable function profiling for gprof]' '-###[print commands to run this compilation]' '-print-file-name=-[display the full path to library <library>]:library:->library' @@ -2128,7 +2119,6 @@ args+=( '-V[specify compiler version]:compiler version:' {-v,--verbose}'[enable verbose output]' '*-Wa,-[pass arguments to the assembler]:assembler option:' - '--warn--[enable the specified warning]:warning:->warning' '*-Werror=-[treat specified warning as error (or all if none specified)]::warning:->warning' '-Wfatal-errors[exit on the first error occurred]' '*-Wl,-[pass arguments to the linker]:linker option:' diff --git a/Completion/Unix/Command/_ghostscript b/Completion/Unix/Command/_ghostscript index 2c6f40a35..021668c60 100644 --- a/Completion/Unix/Command/_ghostscript +++ b/Completion/Unix/Command/_ghostscript @@ -1,4 +1,4 @@ -#compdef gs ghostscript +#compdef gs ghostscript gsnd local -a specs names device diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index e9f72799c..cbf577680 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -70,6 +70,7 @@ _git-add () { '(-f --force)'{-f,--force}'[allow adding otherwise ignored files]' \ '(-i --interactive : -)'{-i,--interactive}'[add contents interactively to index]' \ '(-p --patch)'{-p,--patch}'[like -i but go directly into patch mode for specified files]' \ + "--no-auto-advance[don't advance to next file when selecting hunks interactively]" \ '(-U --unified)'{-U+,--unified=}'[generate diff with given lines of context]:number of lines' \ '--inter-hunk-context=[combine patch hunks closer than specified number of lines]:number of lines' \ '(-e --edit)'{-e,--edit}'[open diff against index in editor]' \ @@ -515,6 +516,7 @@ _git-checkout () { "--ignore-other-worktrees[don't check if another worktree is using this branch]" \ '--recurse-submodules=-[control recursive updating of submodules]::checkout:__git_commits' \ '--no-overlay[remove files from index or working tree that are not in the tree-ish]' \ + "--no-auto-advance[don't advance to next file when selecting hunks interactively]" \ '(-q --quiet --progress)--no-progress[suppress progress reporting]' \ '--progress[force progress reporting]' \ '(*)--pathspec-from-file=[read pathspec from file]:file:_files' \ @@ -1011,6 +1013,7 @@ _git-format-patch () { '--from=[add From: header to email headers]: :_email_addresses' \ '*--add-header=[add an arbitrary header to email headers]:header' \ '--cover-letter[generate a cover letter template]' \ + '(--cover-letter)--commit-list-format=[format commit list in the cover letter]:format:(short-log modern)' \ '--notes=[append notes for the commit after the three-dash line]:: :__git_notes_refs' \ '( --no-signature --signature-file)--signature=[add a signature]:signature' \ '(--signature --signature-file)--no-signature[do not add a signature]' \ @@ -1219,6 +1222,49 @@ _git-gui () { return ret } +(( $+functions[_git-history] )) || +_git-history() { + local curcontext=$curcontext ret=1 + local -a state line common + declare -A opt_args + + _arguments -C \ + ': :->command' \ + '*:: :->option-or-argument' && ret=0 + + case $state in + (command) + declare -a commands + + commands=( + 'reword:rewrite commit message of specified commit' + 'split:interactively split up commit' + ) + + _describe -t commands command commands && ret=0 + ;; + (option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + common=( + "--dry-run[don't update any references]" + '--update-refs=[control which references will be updates]:references [branches]:(branches head)' + ':commit:__git_commits' + ) + + case $line[1] in + reword) _arguments -S -s $endopt $common && ret=0 ;; + split) + _arguments -S -s $endopt $common \ + '*: :__git_ignore_line_inside_arguments __git_tree_files ${PREFIX:-.} ${(Q)line[1]}' && ret=0 + ;; + *) _default && ret=0 ;; + esac + ;; + esac + + return ret +} + (( $+functions[_git-init] )) || _git-init () { _arguments -S -s $endopt \ @@ -1300,7 +1346,8 @@ _git-log () { (( $+functions[_git-maintenance] )) || _git-maintenance() { - local curcontext="$curcontext" state state_descr line ret=1 + local curcontext="$curcontext" ret=1 + local -a state state_descr line args local -A opt_args _arguments -C \ @@ -1324,16 +1371,27 @@ _git-maintenance() { (option-or-argument) curcontext=${curcontext%:*}-$line[1]: case $line[1] in - (run) + run) _arguments -S $endopt \ '--auto[run tasks based on the state of the repository]' \ + '--detach[perform maintenance in the background]' \ '--schedule=[run tasks based on frequency]:frequency (seconds)' \ "--quiet[don't report progress or other information to stderr]" \ '*--task=[run a specific task]:task:(gc commit-graph prefetch loose-objects incremental-repack pack-refs)' && ret=0 ;; - (start) + start) _arguments \ - '--scheduler=:scheduler:(auto crontab systemd-timer launchctl schtasks)' + '--scheduler=:scheduler:(auto crontab systemd-timer launchctl schtasks)' && ret=0 + ;; + unregister) + args=( '(-f --force)'{-f,--force}'[return success even if repository was not registered]' ) + ;& + register) + _arguments -S $endopt $args \ + '--config-file=[use given config file]:config file:_files' && ret=0 + ;; + stop) _message 'no more arguments' ;; + *) _default && ret=0 ;; esac ;; esac @@ -1591,6 +1649,7 @@ _git-range-diff () { '(--right-only)--left-only[only emit output related to the first range]' \ '(--left-only)--right-only[only emit output related to the second range]' \ '(--remerge-diff)--diff-merges=[specify diff format to be used for merge commits]:format [m]:(off none 1 first-parent separate c combined cc dense-combined r remerge m on)' \ + '--max-memory=[specify maximum memory for cost matrix]:memory [4G]' \ '(--diff-merges -p --patch -u)--remerge-diff[produce remerge-diff output for merge commits]' \ $diff_options \ '1:range 1:__git_commit_ranges' \ @@ -1638,6 +1697,7 @@ _git-rebase () { "(--autostash --no-autostash)--no-autostash[don't stash uncommitted changes before rebasing and apply them afterwards]" \ '(--root)--fork-point[use merge-base --fork-point to refine upstream]' \ '--signoff[add Signed-off-by: trailer to the commit message]' \ + '(--force-rebase)*--trailer=[add custom trailer to every rebased commit]:trailer:__git_trailers_tokens' \ '--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \ '(--keep-base)--onto=[start new branch with HEAD equal to given revision]:newbase:__git_revisions' \ "(--apply --whitespace -C)--reschedule-failed-exec[automatically re-schedule any 'exec' that fails]" \ @@ -1661,6 +1721,7 @@ _git-reset () { '(--soft --mixed --hard --merge -p --patch -U --unified --inter-hunk-context -- *)--keep[like --hard, but keep local working tree changes]' \ '--recurse-submodules=-[control recursive updating of submodules]::reset:__git_commits' \ '(-p --patch --soft --mixed -N --intent-to-add --hard --merge --keep)'{-p,--patch}'[select diff hunks to remove from the index]' \ + "--no-auto-advance[don't advance to next file when selecting hunks interactively]" \ '(-U --unified --soft --mixed -N --intent-to-add --hard --merge --keep)'{-U+,--unified=}'[generate diff with given lines of context]:number of lines' \ '(--soft --mixed -N --intent-to-add --hard --merge --keep)--inter-hunk-context=[combine patch hunks closer than specified number of lines]:number of lines' \ '(-N --intent-to-add --soft --mixed --hard --merge --keep -p --patch -U --unified --inter-hunk-context -- *)'{-N,--intent-to-add}'[record only the fact that removed paths will be added later]' \ @@ -1903,6 +1964,7 @@ _git-sparse-checkout() { reapply:'reapply the sparsity pattern rules to paths in the working tree' disable:'disable the config setting, and restore all files in the working directory' check-rules:'check whether sparsity rules match one or more paths' + clean:'remove files outside of the sparse-checkout definition' ) _describe -t commands command commands && ret=0 @@ -1910,7 +1972,7 @@ _git-sparse-checkout() { (option-or-argument) curcontext=${curcontext%:*}-$line[1]: case $line[1] in - init) + init|reapply) _arguments \ '--cone[allow for better performance with a limited set of patterns]' \ '--no-sparse-index[rewrite index to not be sparse]' && ret=0 @@ -1929,6 +1991,12 @@ _git-sparse-checkout() { '--cone[interpret rules file patterns as cone mode patterns]' \ '--rules-file=[use patterns in specified file]:file:_files' && ret=0 ;; + clean) + _arguments \ + '(-f --force)'{-f,--force}'[remove files]' \ + '--dry-run[list the directories that would be removed without deleting them]' \ + '--verbose[list every file considered for removal]' + ;; esac ;; esac @@ -2237,12 +2305,16 @@ _git-submodule () { _git-subtree () { local curcontext="$curcontext" state state_descr line ret=1 declare -A opt_args + local -a common=( + '(-q --quiet)'{-q,--quiet}'[suppress progress output]' + '(-d --debug)'{-d,--debug}'[show debug messages]' + '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=-}'[GPG-sign the commit]::key id' + "(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[don't GPG-sign the commit]" + ) # TODO: -P should only complete paths inside the current repository. - _arguments -C \ - '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ - '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' \ - '(-d --debug)'{-d,--debug}'[show debug messages]' \ + _arguments -C $common \ ': :->command' \ '*::: := ->option-or-argument' && ret=0 @@ -2263,7 +2335,7 @@ _git-subtree () { curcontext=${curcontext%:*}-$line[1]: case $line[1] in (add) - _arguments \ + _arguments $common \ '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ '(-m --message)'{-m+,--message=}'[use the given message as the commit message for the merge commit]:message' \ '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' \ @@ -2276,35 +2348,27 @@ _git-subtree () { # __git_ref_specs. ;; (merge) - _arguments -S \ - '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ - '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' \ + _arguments -S $common \ '(-m --message)'{-m+,--message=}'[use the given message as the commit message for the merge commit]:message' \ '--squash[import only a single commit from the subproject]' \ ': :__git_references' && ret=0 ;; (pull) - _arguments -S \ - '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ - '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' \ + _arguments -S $common \ '(-m --message)'{-m+,--message=}'[use the given message as the commit message for the merge commit]:message' \ '--squash[import only a single commit from the subproject]' \ ': :__git_any_repositories' \ ':: :__git_ref_specs' && ret=0 ;; (push) - _arguments -S \ - '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ - '(-P --prefix)'{-P+,--prefix=}'[the path to the subtree in the repository to manipulate]: :_directories' \ + _arguments -S $common \ '(-m --message)'{-m+,--message=}'[use the given message as the commit message for the merge commit]:message' \ ': :__git_any_repositories' \ ':: :__git_ref_specs' && ret=0 ;; (split) - _arguments -S \ + _arguments -S $common \ '--annotate[add a prefix to commit message of new commits]:prefix' \ - '(-q --quiet)'{-q,--quiet}'[suppress progress output]' \ - '(-P --prefix)'{-P+,--prefix=}'[specify path to the subtree in the repository to manipulate]: :_directories' \ '(-b --branch)'{-b,--branch=}'[create a new branch]' \ '--onto=[try connecting new tree to an existing one]: :__git_ref_specs' \ '(-m --message)'{-m+,--message=}'[specify commit message for the merge]:message' \ @@ -2472,12 +2536,12 @@ _git-worktree() { _arguments -s -S $endopt \ '(-n --dry-run)'{-n,--dry-run}"[don't remove, show only]" \ '(-v --verbose)'{-v,--verbose}'[report pruned objects]' \ - '--expire=[expire objects older than specified time]: :_git_approxidates' && ret=0 + '--expire=[prune missing working trees older than specified time]: :_git_approxidates' && ret=0 ;; (list) _arguments -S $endopt \ '(-v --verbose --porcelain -z)'{-v,--verbose}'[output additional information about worktrees]' \ - "--expire=[add 'prunable' annotation to worktrees older than specified time]: :_git_approxidates" \ + "--expire=[add 'prunable' annotation to missing worktrees older than specified time]: :_git_approxidates" \ '(-v)--porcelain[machine-readable output]' \ '(-v)-z[terminate each line with a NUL rather than a newline]' && ret=0 ;; @@ -2527,56 +2591,71 @@ _tig () { (( $+functions[_git-config] )) || _git-config () { + local curcontext="$curcontext" ret=1 + local -a state state_descr line + local -a location filter display type include default comment + local -A opt_args local name_arg value_arg - local curcontext=$curcontext state line ret=1 - declare -A opt_args if (( words[(I)--get-regexp] )); then name_arg=':name regex' - elif (( words[(I)--get-colorbool] )); then - name_arg=':: :->is-a-tty' elif (( words[(I)--get-color] )); then name_arg='::default' elif (( words[(I)--remove-section|--rename-section] )); then - name_arg=': :->section' + name_arg=': : __git_config_sections -b "(|)" "^" section-names "section name"' elif (( words[(I)--get|--get-all] )); then - name_arg=': :->gettable-option' + name_arg=': :->gettable-options' else - name_arg=': :->option' + name_arg=': :->commands-options' fi if (( words[(I)--rename-section] )); then - value_arg=': :->section' + value_arg=': : __git_config_sections -b "(|)" "^" section-names "section name"' else - value_arg=': :->value' + value_arg='*::: := ->values' fi - _arguments -C -S -s $endopt \ - '( --system --local --worktree -f --file --blob)--global[use user-global config file]' \ - '(--global --local --worktree -f --file --blob)--system[use system-wide config file]' \ - '(--global --system --worktree -f --file --blob)--local[use local config file]' \ - '(--global --system --local -f --file --blob)--worktree[use per-worktree config file]' \ - '(--global --system --local --worktree --blob)'{-f+,--file=}'[use given config file]:config file:_files' \ - '(--global --system --local --worktree -f --file)--blob=[read config from given blob object]:blob:__git_blobs' \ - '(-t --type --bool --int --bool-or-int --bool-or-str --path --expiry-date)'{-t+,--type=}'[ensure that incoming and outgoing values are canonicalize-able as the given type]:type:(bool int bool-or-int bool-or-str path expiry-date color)' \ - '(-t --type --int --bool-or-int --bool-or-str --path --expiry-date)--bool[setting is a boolean]' \ - '(-t --type --bool --bool-or-int --bool-or-str --path --expiry-date)--int[setting is an integer]' \ - '(-t --type --bool --int --bool-or-str --path --expiry-date)--bool-or-int[setting is a boolean or integer]' \ - '(-t --type --bool --int --bool-or-int --path --expiry-date)--bool-or-str[setting is a boolean or string]' \ - '(-t --type --bool --int --bool-or-int --bool-or-str --expiry-date)--path[setting is a path]' \ - '(-t --type --bool --int --bool-or-int --bool-or-str --path)--expiry-date[setting is an expiry date]' \ - '(-z --null)'{-z,--null}'[end values with NUL and newline between key and value]' \ - '--fixed-value[use string equality when comparing values]' \ - '(--get --get-all --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool)--name-only[show variable names only]' \ - '(--includes)'--no-includes"[don't respect \"include.*\" directives]" \ - '(--no-includes)'--includes'[respect "include.*" directives in config files when looking up values]' \ - '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-scope)--show-origin[show origin of config]' \ - '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-origin)--show-scope[show scope of config (worktree, local, global, system, command)]' \ - '(2 --add -e --edit -l --list --name-only --rename-section --remove-section --replace-all --unset --unset-all)--default=[with --get, use specified default value when entry is missing]:default' \ - '--comment=[specify human-readable comment string]:comment' \ + location=( + '(--system --local --worktree -f --file --blob)--global[use user-global config file]' + '(--global --local --worktree -f --file --blob)--system[use system-wide config file]' + '(--global --system --worktree -f --file --blob)--local[use local config file]' + '(--global --system --local -f --file --blob)--worktree[use per-worktree config file]' + '(--global --system --local --worktree --blob)'{-f+,--file=}'[use given config file]:config file:_files' + '(--global --system --local --worktree -f --file)--blob=[read config from given blob object]:blob:__git_blobs' + ) + filter=( + '--fixed-value[use string equality when comparing values]' + ) + display=( + '(-z --null)'{-z,--null}'[end values with NUL and newline between key and value]' + '(--get --get-all --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool)--name-only[show variable names only]' + '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-scope)--show-origin[show origin of config]' + '(--global --system --local -f --file --blob --get-urlmatch --replace-all --add --unset --unset-all --rename-section --remove-section -e --edit --get-color --get-colorbool --show-origin)--show-scope[show scope of config (worktree, local, global, system, command)]' + '--show-names[show config keys in addition to their values]' + ) + type=( + '(-t --type --bool --int --bool-or-int --bool-or-str --path --expiry-date)'{-t+,--type=}'[ensure that incoming and outgoing values are canonicalize-able as the given type]:type:(bool int bool-or-int bool-or-str path expiry-date color)' + '(-t --type --int --bool-or-int --bool-or-str --path --expiry-date)--bool[setting is a boolean]' + '(-t --type --bool --bool-or-int --bool-or-str --path --expiry-date)--int[setting is an integer]' + '(-t --type --bool --int --bool-or-str --path --expiry-date)--bool-or-int[setting is a boolean or integer]' + '(-t --type --bool --int --bool-or-int --path --expiry-date)--bool-or-str[setting is a boolean or string]' + '(-t --type --bool --int --bool-or-int --bool-or-str --expiry-date)--path[setting is a path]' + '(-t --type --bool --int --bool-or-int --bool-or-str --path)--expiry-date[setting is an expiry date]' + ) + include=( + '(--includes)'--no-includes"[don't respect \"include.*\" directives]" + '(--no-includes)'--includes'[respect "include.*" directives in config files when looking up values]' + ) + default=( + '(2 --add -e --edit -l --list --name-only --rename-section --remove-section --replace-all --unset --unset-all)--default=[with --get, use specified default value when entry is missing]:default' + ) + comment=( + '--comment=[specify human-readable comment string]:comment' + ) + + _arguments -C -S -s $endopt $location $filter $display $type $include $default \ $name_arg \ $value_arg \ - '::value regex' \ - '(actions)' \ '(2 --name-only)--get[get the first matching value of the key]' \ '(2 --name-only)--get-all[get all matching values of the key]' \ @@ -2590,25 +2669,79 @@ _git-config () { '(3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--remove-section[remove the given section]' \ '(: --bool --int --bool-or-int --bool-or-str --path)'{-l,--list}'[list all variables set in config file]' \ '(-e --edit --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)'{-e,--edit}'[open config file for editing]' \ - '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-color[find color setting]: :->gettable-color-option' \ - '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-colorbool[check if color should be used]: :->gettable-colorbool-option' && ret=0 - __git_config_option-or-value "$@" && ret=0 + '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-color[find color setting]: :->gettable-color-options' \ + '(2 3 --bool --int --bool-or-int --bool-or-str --path -z --null --name-only --show-origin)--get-colorbool[check if color should be used]: :->gettable-colorbool-options:stdout is tty:(true false auto)' && ret=0 + + filter+=( + '--all[return all values for multi-valued config options]' + '--value=[show config with values matching the pattern]:pattern' + ) + + case $state/$line[1] in + values/(list|get|set|unset|re(name|move)-section|edit)) + curcontext=${curcontext%:*}-$line[1]: + ;| + values/list) + _arguments $location $display $type $include && ret=0 + ;; + values/get) + _arguments $location $display $type $filter $include $default \ + '--regexp[interpret the name as a regular expression]' \ + '--url=[show config matching the given URL]:url:_urls' && ret=0 + ;; + values/set) + _arguments $location $type $filter $comment \ + '--append[add a new line without altering any existing values]' && ret=0 + ;; + values/unset) + _arguments $location $type $filter && ret=0 + ;; + values/rename-section) + _arguments $location \ + ': : __git_config_sections -b "(|)" "^" section-names "old section name"' \ + ': : __git_config_sections -b "(|)" "^" section-names "new name"' && ret=0 + ;; + values/remove-section) + _arguments $location \ + ': : __git_config_sections -b "(|)" "^" section-names "section"' && ret=0 + ;; + values/edit) + _arguments $location && ret=0 + ;; + commands-options/*) + _alternative \ + 'commands:command:(( + list:"list variables along with their values" + get:"emit the value for the specified key" + set:"set value for one or more config options" + unset:"remove value for one or more config options" + rename-section:"rename given section to a new name" + remove-section:"remove given section from the configuration file" + edit:"open editor to modify specified config file" + ))' \ + 'option-names: : __git_config_option-or-value' && ret=0 + ;; + *) + __git_config_option-or-value "$@" && ret=0 + ;; + esac + return ret } (( $+functions[__git_config_option] )) || __git_config_option () { - local -A opt_args=() + local -A opt_args local -a line=( ${words[CURRENT]%%=*} ) - local state=option + local state=options __git_config_option-or-value "$@" } (( $+functions[__git_config_value] )) || __git_config_value () { - local -A opt_args=() + local -A opt_args local -a line=( ${words[CURRENT]%%=*} ${words[CURRENT]#*=} ) - local state=value + local state=values __git_config_option-or-value "$@" } @@ -2810,7 +2943,7 @@ __git_config_option-or-value () { 'diff.*.textconv:command to generate the text-converted version of a file::_cmdstring' 'diff.*.wordregex:regular expression that the diff driver should use to split words in a line:regular expression:->string' 'diff.*.xfuncname:regular expression that the diff driver should use to recognize the hunk header:regular expression:->string' - diff.algorithm:'default diff algorithm::->diff.algorithm:default' + diff.algorithm:"default diff algorithm::_git_diff_algorithms" diff.autorefreshindex:'run git update-index --refresh before git diff::->bool:true' diff.colorMoved:"color moved lines in diffs::__git_color_moved" diff.colorMovedWS:"ignore whitespace when detecting moved lines::__git_color_movedws" @@ -3292,18 +3425,7 @@ __git_config_option-or-value () { } case $state in - (section) - __git_config_sections -b '(|)' '^' section-names 'section name' $* && ret=0 - ;; - (is-a-tty) - declare -a values - values=( - true - false - auto) - _describe -t values 'stdout is a tty' values && ret=0 - ;; - (option) + (commands-|)options) local label=option declare -a sections sections_and_options options @@ -3522,16 +3644,16 @@ __git_config_option-or-value () { sections_and_options -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' -qS . -- \ options -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' "$@" && ret=0 ;; - (gettable-option) + (gettable-options) _wanted git-options expl option compadd -M 'r:|.=* r:|=*' -a - git_present_options && ret=0 ;; - (gettable-colorbool-option) + (gettable-colorbool-options) __git_config_sections -b '(|)' -a '(|)' '^color\.[^.]+$' gettable-colorbool-options option && ret=0 ;; - (gettable-color-option) + (gettable-color-options) __git_config_sections -b '(|)' -a '(|)' '^color\.[^.]+\..*$' gettable-color-options option && ret=0 ;; - (value) + (values) local current=${${(0)"$(_call_program current "git config $opt_args[(I)--system|--global|--local]" ${(kv)opt_args[(I)-f|--file]} "-z --get ${(q)line[1]}")"}#*$'\n'} case $line[1] in (alias.*) @@ -3689,14 +3811,6 @@ __git_config_option-or-value () { __git_guard_number 'number of days' fi ;; - (diff.algorithm) - __git_config_values -- "$current" "$parts[5]" \ - default:'basic greedy diff algorithm' \ - myers:'basic greedy diff algorithm' \ - minimal:'spend extra time to make sure the smallest possible diff is produced' \ - patience:'generate diffs with patience algorithm' \ - histogram:'generate diffs with histogram algorithm' && ret=0 - ;; (diff.renames) __git_config_booleans "$current" "$parts[5]" "$parts[2]" \ {copies,copy}:'try to detect both renames and copies' && ret=0 @@ -4072,6 +4186,7 @@ _git-reflog () { 'show:show log of ref' 'drop:remove reflog for specified references' 'exists:check whether a ref has a reflog' + 'write:write reflog entry for a reference' ) _alternative \ @@ -4114,7 +4229,10 @@ _git-reflog () { ;; (exists) __git_references && ret=0 - ;; + ;; + write) + _arguments ': :__git_references' ':old oid' ':new oid' ':message' && ret=0 + ;; esac esac @@ -4138,6 +4256,9 @@ _git-refs() { commands=( 'migrate:migrate ref store between different formats' 'verify:verify reference database consistency' + 'list:list references in the repository, alias for git-for-each-ref' + 'exists:check whether given reference exists' + 'optimize:optimize references to improve repository performance, alias for git-pack-refs' ) _describe -t commands command commands && ret=0 @@ -4157,6 +4278,9 @@ _git-refs() { '--strict[enable stricter error checking]' \ '--verbose[when verifying the reference database consistency, be chatty]' && ret=0 ;; + list) _git-for-each-ref && ret=0 ;; + exists) __git_references && ret=0 ;; + optimize) _git-pack-refs && ret=0 ;; *) _default && ret=0 ;; esac ;; @@ -4363,6 +4487,7 @@ _git-blame () { '(-n --show-number)'{-n,--show-number}'[show the line number in the original commit]' \ '-s[suppress author name and timestamp]' \ '-w[ignore whitespace when finding lines]' \ + '--diff-algorithm=[choose a diff algorithm to use when computing blame]: :_git_diff_algorithms' \ '--ignore-rev=[ignore specified revision when blaming]:revision:__git_revisions' \ '--ignore-revs-file=[ignore revisions from file]:file:_files' \ '(--color-by-age)--color-lines[color redundant metadata from previous line differently]' \ @@ -4841,10 +4966,14 @@ _git-send-email () { '--smtp-server-port=[specify port to connect to SMTP server on]:smtp port:_ports' \ '--smtp-server-option=[specify the outgoing SMTP server option to use]:SMTP server option' \ '--smtp-ssl-cert-path=[path to ca-certificates (directory or file)]:ca certificates path:_files' \ + '--smtp-ssl-client-cert=[path to client certificate file]: :_files' \ + '--smtp-ssl-client-key=[path to the private key file for the client certificate]: :_files' \ '--smtp-user=[specify user to use for SMTP-AUTH]:smtp user:_users' \ '(--no-smtp-auth)--smtp-auth=[specify allowed AUTH mechanisms]:space-separated list of mechanisms' \ '(--smtp-auth)--no-smtp-auth[disable SMTP authentication]' \ '--smtp-debug=[enable or disable debug output]:smtp debug:((0\:"disable" 1\:"enable"))' \ + '--imap-sent-folder=[IMAP folder where a copy of the emails should be sent]:IMAP folder' \ + '--use-imap-only[only copy emails instead of actually sending them]' \ '--batch-size=[specify maximum number of messages per connection]:number' \ '--relogin-delay=[specify delay between successive logins]:delay (seconds)' \ '--cc-cmd=[specify command to generate Cc\: header with]:Cc\: command:_cmdstring' \ @@ -5328,11 +5457,7 @@ _git-merge-file () { '( --theirs --union)--ours[resolve conflicts favoring our side of the lines]' \ '(--ours --union)--theirs[resolve conflicts favoring their side of the lines]' \ '(--ours --theirs )--union[resolve conflicts favoring both sides of the lines]' \ - '--diff-algorithm=[choose a diff algorithm]:diff algorithm:((default\:"basic greedy diff algorithm" - myers\:"basic greedy diff algorithm" - minimal\:"spend extra time to make sure the smallest possible diff is produced" - patience\:"generate diffs with patience algorithm" - histogram\:"generate diffs with histogram algorithm"))' \ + '--diff-algorithm=[choose a diff algorithm]: :_git_diff_algorithms' \ '--marker-size[specify length of conflict markers]: :__git_guard_number "marker length"' \ '--object-id[use object IDs instead of filenames]' \ '(--zdiff3)--diff3[show conflicts in "diff3" style]' \ @@ -5377,10 +5502,13 @@ _git-multi-pack-index() { _arguments \ '--object-dir=[specify location of git objects]:directory:_directories' \ '(--progress)--no-progress[turn progress off]' '!(--no-progress)--progress' \ + '--preferred-pack=[break ties in favor of specified pack]:pack' \ + '--bitmap[write a multi-pack bitmap]' \ '--stdin-packs[write a multi-pack index containing only pack index basenames provided on stdin]' \ '--refs-snapshot=[specify a file which contains a "refs snapshot" taken prior to repacking]:file:_files' \ + '--incremental[write an incremental MIDX file]' \ '--batch-size=[during repack, select packs so as to have pack files of at least the specified size]:size' \ - '1:verb:(write verify expire repack)' + '1:verb:(write compact verify expire repack)' } (( $+functions[_git-pack-objects] )) || @@ -5494,6 +5622,21 @@ _git-read-tree () { '3::third tree-ish to be read/merged:__git_tree_ishs' } +(( $+functions[_git-replay] )) || +_git-replay() { + _arguments -S $endopt \ + '(--advance --revert)--contained[update all branches that point to commits in given range]' \ + '(--advance --revert)--onto=[replay onto given commit]: :__git_revisions' \ + '(--onto --revert)--advance=[advance given branch]: :__git_branches' \ + '(--onto --advance)--revert=[revert commits onto given branch]: :__git_branches' \ + '--ref=[specify reference to update with result]: :__git_ref_specs' \ + '--ref-action=[control ref update behavior]:behavior:(( + update\:"update directly using atomic transaction" + print\:"output update-ref commands for pipeline use" + ))' \ + ':revision range:__git_commit_ranges' +} + (( $+functions[_git-symbolic-ref] )) || _git-symbolic-ref () { _arguments -S -s \ @@ -6280,7 +6423,10 @@ _git-hook() { _arguments $args \ '--ignore-missing[ignore any missing hook by quietly returning zero]' \ "--to-stdin=[specify file which will be redirected to hook's stdin]:file:_files" \ - '1:subcommand:(run)' \ + '--allow-unknown-hook-name' \ + '-z[terminate output lines with NUL instead of newlines]' \ + '--show-scope[prefix each hook name with a config scope]' \ + '1:subcommand:(run list)' \ '2:hook name:compadd $gitdir/hooks/*(x\:t)' } @@ -6523,6 +6669,7 @@ _git_commands () { gc:'cleanup unnecessary files and optimize local repository' grep:'print lines matching a pattern' gui:'run portable graphical interface to git' + history:'rewrite history' init:'create empty git repository or re-initialize an existing one' log:'show commit logs' maintenance:'run tasks to optimize Git repository data' @@ -6533,7 +6680,7 @@ _git_commands () { push:'update remote refs along with associated objects' range-diff:'compare two commit ranges' rebase:'forward-port local commits to the updated upstream head' - reset:'reset current HEAD to specified state' + reset:'reset HEAD or the index to a known state' restore:'restore working tree files' revert:'revert existing commits' rm:'remove files from the working tree and from the index' @@ -6545,7 +6692,7 @@ _git_commands () { submodule:'initialize, update, or inspect submodules' subtree:'split repository into subtrees and merge them' switch:'switch branches' - tag:'create, list, delete or verify tag object signed with GPG' + tag:'create, list, delete or verify tags' worktree:'manage multiple working dirs attached to the same repository' ) ancillary_manipulator_commands=( @@ -6606,6 +6753,7 @@ _git_commands () { pack-objects:'create packed archive of objects' prune-packed:'remove extra objects that are already in pack files' read-tree:'read tree information into directory index' + replay:'replay commits on a new base, works with bare repos too' symbolic-ref:'read and modify symbolic references' unpack-objects:'unpack objects from packed archive' update-index:'register file contents in the working directory to the index' @@ -6779,6 +6927,17 @@ __git_date_formats () { _describe -t date-formats 'date format' date_formats -- '( format\:custom\ format )' -S : } +(( $+functions[_git_diff_algorithms] )) || +_git_diff_algorithms() { + _describe -t diff-algorithms 'diff algorithm' '( + default\:"basic greedy diff algorithm" + myers\:"basic greedy diff algorithm" + minimal\:"spend extra time to produce smallest possible diff" + patience\:"generate diffs with patience algorithm" + histogram\:"generate diffs with histogram algorithm" + )' +} + (( $+functions[_git_diff_filters] )) || _git_diff_filters() { local sep @@ -6849,7 +7008,7 @@ _git_strategy_options() { renormalize no-renormalize \ 'find-renames::similarity threshold' \ subtree:path \ - 'diff-algorithm:algorithm:(patience minimal histogram myers)' + 'diff-algorithm:algorithm:_git_diff_algorithms' } (( $+functions[__git_encodings] )) || @@ -8172,11 +8331,7 @@ __git_setup_diff_options () { '(--minimal --patience --histogram --diff-algorithm)--patience[generate diffs with patience algorithm]' '(--minimal --patience --histogram --diff-algorithm)--histogram[generate diffs with histogram algorithm]' '(--minimal --patience --histogram --diff-algorithm)*--anchored=[generate diffs using the "anchored diff" algorithm]:text' - '(--minimal --patience --histogram --diff-algorithm)--diff-algorithm=[choose a diff algorithm]:diff algorithm:((default\:"basic greedy diff algorithm" - myers\:"basic greedy diff algorithm" - minimal\:"spend extra time to make sure the smallest possible diff is produced" - patience\:"generate diffs with patience algorithm" - histogram\:"generate diffs with histogram algorithm"))' + '(--minimal --patience --histogram --diff-algorithm)--diff-algorithm=[choose a diff algorithm]: :_git_diff_algorithms' \ '--stat=-[generate diffstat instead of patch]:: :__git_guard_diff-stat-width' '--stat-width=-[generate diffstat with a given width]:width' '--stat-graph-width=-[generate diffstat with a given graph width]:width' @@ -8208,6 +8363,7 @@ __git_setup_diff_options () { "(--color-moved-ws)--no-color-moved-ws=[don't ignore whitespace when performing move detection]" "--ita-invisible-in-index[hide 'git add -N' entries from the index]" "!(--ita-invisible-in-index)--ita-visible-in-index" + '--max-depth=[specify maximum tree depth to recurse]:depth' '--no-renames[turn off rename detection]' $exclusive_diff_options'--check[warn if changes introduce trailing whitespace or space/tab indents]' '--full-index[show full object name of pre- and post-image blob]' @@ -8225,7 +8381,7 @@ __git_setup_diff_options () { '--diff-filter=-[select certain kinds of files for diff]: :_git_diff_filters' '-S-[look for differences that add or remove the given string]:string' '-G-[look for differences whose added or removed line matches the given regex]:pattern' - '--pickaxe-all[when -S finds a change, show all changes in that changeset]' + '--pickaxe-all[when -G or -S find a change, show all changes in that changeset]' '--pickaxe-regex[treat argument of -S as regular expression]' '-O-[output patch in the order of glob-pattern lines in given file]: :_files' '--rotate-to=[show the change in specified path first]:path:_directories' diff --git a/Completion/Unix/Command/_gphoto2 b/Completion/Unix/Command/_gphoto2 index 788c9702f..df17aa111 100644 --- a/Completion/Unix/Command/_gphoto2 +++ b/Completion/Unix/Command/_gphoto2 @@ -11,6 +11,7 @@ _arguments -s -C \ '--debug-loglevel=[set debug level]:debug level:(error debug data all)' \ '--debug-logfile=[name of file to write debug info to]:file:_files' \ '(-q --quiet)'{-q,--quiet}'[quiet output]' \ + '(-q --quiet)--parsable[simple parsable output]' \ '--hook-script=[hook script to call after downloads, captures, etc.]:file:_files' \ '--stdout[send file to stdout]' \ '--stdout-size[print filesize before data]' \ @@ -41,8 +42,8 @@ _arguments -s -C \ '--keep[keep images on camera after capturing]' \ '--keep-raw[keep the RAW images on the camera with --capture-image-and-download]' \ '--no-keep[remove images from camera after capturing]' \ - '--wait-event=-[wait for event from camera]::count' \ - '--wait-event-and-download=-[wait for event from camera and download new images]::count' \ + '--wait-event=-[wait for event from camera]:: :_numbers -u events -d forever wait\ time s\:seconds ms\:milliseconds' \ + '--wait-event-and-download=-[wait for event from camera and download new images]:: :_numbers -u events -d forever wait\ time s\:seconds ms\:milliseconds' \ '--capture-preview[capture a quick preview]' \ '--show-preview[capture a quick preview and display using ASCII art]' \ '(-B --bulb)'{-B,--bulb=}'[set bulb exposure time]:exposure time (seconds)' \ @@ -54,7 +55,7 @@ _arguments -s -C \ '--capture-image-and-download[capture an image and download it]' \ '--capture-movie=-[capture a movie]:count or seconds' \ '--capture-sound[capture an audio clip]' \ - '--capture-tethered=-[wait for shutter release on the camera and download]::count' \ + '--capture-tethered=-[wait for shutter release on the camera and download]:: :_numbers -u events wait\ time s\:seconds ms\:milliseconds' \ '(-l --list-folders)'{-l,--list-folders}'[list folders in folder]' \ '(-L --list-files)'{-L,--list-files}'[list files in folder]' \ '(-m --mkdir)'{-m,--mkdir=}'[create a directory]:directory' \ @@ -75,6 +76,7 @@ _arguments -s -C \ '(-D --delete-all-files)'{-D,--delete-all-files}'[delete all files in folder]' \ '(-u --upload-file)'{-u,--upload-file=}'[upload a file to camera]:file:_files' \ '--filename=[specify pattern to save file as]:pattern:_date_formats' \ + '--filenumber=[specify the number %n in the filename pattern starts at]:starting number [1]' \ '(-f --folder)'{-f,--folder=}'[specify camera folder]:folder [/]' \ '(-R --recurse --no-recurse)'{-R,--recurse}'[recursion (default for download)]' \ '(-R --recurse)--no-recurse[no recursion (default for deletion)]' \ diff --git a/Completion/Unix/Command/_id b/Completion/Unix/Command/_id index 64b8c9b37..ce18ed719 100644 --- a/Completion/Unix/Command/_id +++ b/Completion/Unix/Command/_id @@ -44,8 +44,10 @@ else freebsd*) args+=( '(-)-A[print process audit user ID]' - '(-)-M[print MAC label of the current process]' + '(- 1)-M[print MAC label of the current process]' '(-)-c[print current login class]' + '(-)-d[print home directory]' + '(-)-s[print shell]' ) ;| darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d index cdc373297..7b3c8ee41 100644 --- a/Completion/Unix/Command/_init_d +++ b/Completion/Unix/Command/_init_d @@ -1,7 +1,7 @@ #compdef -p */(init|rc[0-9S]#).d/* -local cmds script -local -a flags +local cmds script state +local -a flags line _compskip=all @@ -122,4 +122,21 @@ cmds=( $(_init_d_get_cmds) ) || return 1 (( $#cmds )) || zstyle -a ":completion:${curcontext}:commands" commands cmds || cmds=(start stop) -_arguments -s -A "-*" $flags ':init.d command:_sub_commands $cmds' +local svcname=$words[1] ret=1 + +_arguments -C -s -A "-*" $flags \ + ':init.d command:_sub_commands $cmds' \ + '*:: :->svcargs' && ret=0 + +if [[ $state == svcargs ]]; then + case $svcname:$line[1] in + jail:(*stop|*restart|console|status)) _jails && ret=0 ;; + jail:*) _jails -c && ret=0 ;; + netif:*) _net_interfaces && ret=0 ;; + *) + _call_function ret _init_d-$svcname $line[1] + ;; + esac +fi + +return ret diff --git a/Completion/Unix/Command/_ip b/Completion/Unix/Command/_ip index 9a7cbd821..d63ddedab 100644 --- a/Completion/Unix/Command/_ip +++ b/Completion/Unix/Command/_ip @@ -21,12 +21,12 @@ local -a subcmd_string subcmd_string=(/$'[^\0]#\0'/ ':string:arbitrary string:( )') local -a subcmd_number -subcmd_number=(/$'[0-9]##\0'/ ':number:decimal number:( )') +subcmd_number=(/$'[0-9]##\0'/ ': _message -e numbers "decimal number"') local xp='[[:xdigit:]][[:xdigit:]]' local -a subcmd_lladdr subcmd_lladdr=(/"${xp}:${xp}:${xp}:${xp}:${xp}:${xp}"$'\0'/ -':lladdress:link layer (MAC) address:( )') + ': _message -e lladdresses "link layer (MAC) address"') local -a subcmd_ipaddr subcmd_ipaddr=( @@ -57,7 +57,7 @@ _regex_words scope "IP address scope" \ subcmd_scope=("$reply[@]") local -a subcmd_nud -_regex_words nud "Neighbour Unreachability Detection state" \ +_regex_words nud "neighbour unreachability detection state" \ 'permanent:valid forever' \ 'noarp:valid, not validated, removed if expired' \ 'reachable:valid until reachability timeout' \ @@ -65,7 +65,7 @@ _regex_words nud "Neighbour Unreachability Detection state" \ subcmd_nud=("$reply[@]") local -a subcmd_rttype -_regex_words route-type "Route type" \ +_regex_words route-type "route type" \ 'unicast:real point-to-point route' \ 'unreachable:generate Host Unreachable messages' \ 'blackhole:silently discard' \ @@ -85,12 +85,12 @@ local -a subcmd_route subcmd_route=("(" $subcmd_rttype "|" ")" $subcmd_ipaddr) local -a subcmd_tos -_regex_words tos "type of service" \ +_regex_words tos "service type" \ 'lowdelay:low latency' \ 'throughput:high bulk throughput' \ 'reliability:high reliability' subcmd_tos=("(" "$reply[@]" "|" - /$'(|0x)[[:xdigit:]]##\0'/ ":hex-number:8-bit hex number:( )" ")") + /$'(|0x)[[:xdigit:]]##\0'/ ":hex-numbers:8-bit hex number:( )" ")") local -a subcmd_lockmtu subcmd_lockmtu=("(" /$'lock\0'/ ":lock:lock:(lock)" "|" ")" $subcmd_number ) @@ -123,7 +123,7 @@ local -a subcmd_rtrealm subcmd_rtrealms _regex_words -t / rtrealm 'routing realm' \ 'cosmos:everywhere' subcmd_rtrealms=("(" "$reply[@]" "|" /$'[0-9]##/'/ - ':number:decimal number:( )' ")") + ':numbers:decimal number:( )' ")") _regex_words rtrealm 'routing realm' \ 'cosmos:everywhere' @@ -160,22 +160,46 @@ _regex_words tunnelmode 'tunnel mode' \ 'gre:Generic Route Encapsulation - IPv4/IPv6 in IPv4 tunnel' subcmd_tunnelmode=("$reply[@]") -local -a subcmd_files -subcmd_files=(/$'[^\0]##\0'/ ':file:file name:_files') +local -a subcmd_linktype +subcmd_linktype=(/$'[^\0]##\0'/ ':link-types:link type:(bridge bond dummy hsr ifb ipoib macvlan macvtap vcan veth vlan vxlan ip6tnl ipip sit gre gretap ip6gre ip6gretap vti nlmon ipvlan lowpan geneve macsec vrf)') +local -a subcmd_files +subcmd_files=(/$'[^\0]##\0'/ ':files:file:_files') # # The ip top-level commands. First link # + +local -a link_common_cmds +link_common_cmds=( + 'txq*ueuelen:specify length of transmit queue:$subcmd_number' \ + 'ad*dress:specify unicast link layer (MAC) address:$subcmd_lladdr' \ + 'br*oadcast:specify broadcast link layer (MAC) address:$subcmd_lladdr' \ + 'm*tu:specify maximum transmit unit:$subcmd_number' +) +local -a link_add_cmds +_regex_words \ + link-add-commands 'link add command' $link_common_cmds \ + 'link:specify device:$subcmd_dev' \ + 'name:specify name' \ + 'type:specify type:$subcmd_linktype' \ + 'numtxqueues:specify number of transmit queues:$subcmd_number' \ + 'numrxqueues:specify number of receive queues:$subcmd_number' \ + 'index:specify desired index' \ + 'group:multicast IP address to join:$subcmd_lladdr' +link_add_cmds=( "$reply[@]" "#" ) + local -a link_set_cmds _regex_words \ - link-set-commands 'link set commands' \ + link-set-commands 'link set command' \ 'dev:specify device:$subcmd_dev' \ 'u*p:change state to up' \ 'do*wn:change state to down' \ 'ar*p:change ARP flag on device:$subcmd_onoff' \ 'mu*lticast:change MULTICAST flag on device:$subcmd_onoff' \ + 'allmulticast:change allmulticast flag on device:$subcmd_onoff' \ 'pr*omisc:set promiscuous mode:$subcmd_onoff' \ + 'protodown:change the PROTODOWN state on the device:$subcmd_onoff' \ 'dy*namic:change DYNAMIC flag on device:$subcmd_onoff' \ 'n*ame:change name of device:$subcmd_string' \ 'txq*ueuelen:specify length of transmit queue:$subcmd_number' \ @@ -189,7 +213,7 @@ _regex_words \ link_set_cmds=("(" $subcmd_dev "|" ")" "$reply[@]" "#" ) local -a link_show_cmds -_regex_words link-show-commands 'link show commands' \ +_regex_words link-show-commands 'link show command' \ 'dev:specify device:$subcmd_dev' \ 'up:limit display to running devices' link_show_cmds=("(" $subcmd_dev "|" ")" "$reply[@]" "#" ) @@ -197,15 +221,16 @@ link_show_cmds=("(" $subcmd_dev "|" ")" "$reply[@]" "#" ) local -a link_cmds _regex_words \ link-commands "link command" \ + 'a*dd:add virtual link:$link_add_cmds' \ 'h*elp:show help for command' \ 'se*t:change device attributes:$link_set_cmds' \ 'sh*ow:display device attributes:$link_show_cmds' link_cmds=("$reply[@]") - # # addr # + local -a addr_add_cmds # TODO: broadcast can take + or = _regex_words addr-add-commands "addr add/remove/change/replace commands" \ @@ -214,7 +239,12 @@ _regex_words addr-add-commands "addr add/remove/change/replace commands" \ 'p*eer:specify peer IP address (point-to-point):$subcmd_ipaddr' \ 'b*roadcast:specify broadcast IP address:$subcmd_ipaddr' \ 'la*bel:specify tag for device:$subcmd_string' \ - 's*cope:specify scope for address:$subcmd_scope' + 's*cope:specify scope for address:$subcmd_scope' \ + 'valid_lft:specify valid lifetime of this address' \ + 'preferred_lft:specify valid lifetime of this address' \ + 'home:designate this address as the "home address" (IPv6)' \ + 'mngtmpaddr:manage temporary addresses created from this one as template on behalf of Privacy Extensions' + # can complete IP address with no keyword addr_add_cmds=("(" $subcmd_ipaddr "|" ")" "$reply[@]" "#" ) @@ -225,9 +255,10 @@ local -a addr_show_cmds # TODO: broadcast can take + or = _regex_words addr-show-commands "addr show commands" \ 'dev:specify device:$subcmd_dev' \ + 'up:limit display to running devices' \ 's*cope:specify scope for address:$subcmd_scope' \ 't*o:limit to given IP address/prefix:$subcmd_ipaddr' \ - 'la*bel:list tags matching glob patter:$subcmd_string' \ + 'la*bel:list tags matching glob pattern:$subcmd_string' \ 'dynamic:list addresses from stateless configuration (IPv6)' \ 'permanent:list non-dynamic addresses (IPv6)' \ 'tentative:list addresses failing duplicate address detection (IPv6)' \ @@ -275,12 +306,13 @@ _regex_words \ 'a*dd: add an address labels:$addrlabel_add_cmds' \ 'd*el: delete an address labels:$addrlabel_del_cmds' \ 'l*ist: list address labels' \ - 'f*lush: flush adderss labels' + 'f*lush: flush address labels' addrlabel_cmds=("$reply[@]") # # neigh # + local -a neigh_add_cmds _regex_words neigh-add-commands "neighbour add command" \ 't*o:add new neighbour IP address:$subcmd_ipaddr' \ @@ -320,6 +352,7 @@ neigh_cmds=("$reply[@]") # # route # + local -a route_add_cmds _regex_words route-add-commands "route add/change/replace command" \ 'to:route destination prefix:$subcmd_route' \ @@ -392,13 +425,13 @@ _regex_words \ 'g*et:get a single network route:$route_get_cmds' route_cmds=("$reply[@]") - # # rule # + local -a rule_add_cmds _regex_words rule-add-commands 'ip rule add/delete commands' \ - 'ty*xpe:type of rule:$subcmd_ruletypes' \ + 'ty*pe:type of rule:$subcmd_ruletypes' \ 'fr*om:select source prefix:$subcmd_ipaddr' \ 'to:select destination prefix:$subcmd_ipaddr' \ 'iif:select input interface (device):$subcmd_dev' \ @@ -422,10 +455,10 @@ _regex_words \ 's*how:list routing rules' rule_cmds=("$reply[@]") - # # tunnel # + local -a tunnel_add_cmds _regex_words tunnel-add-commands 'tunnel add/change/delete commands' \ 'na*me:select tunnel device name:$subcmd_dev' \ @@ -460,10 +493,10 @@ _regex_words \ 's*how:list IP tunnels' tunnel_cmds=("$reply[@]") - # # maddr # + local -a maddr_add_cmds _regex_words maddr-add-commands "maddr add/delete command" \ 'a*ddress:select link layer (MAC) address:$subcmd_lladdr' \ @@ -485,10 +518,10 @@ _regex_words \ 's*how:list multicast addresses:$maddr_show_cmds' maddr_cmds=("$reply[@]") - # # mroute # + local -a mroute_show_cmds _regex_words mroute-show-commands "mroute show command" \ 'to:select destination prefix:$subcmd_ipaddr' \ @@ -503,10 +536,10 @@ _regex_words \ 's*how:list multicast routing cache entries:$mroute_show_cmds' mroute_cmds=("$reply[@]") - # # monitor # + local -a monitor_cmds _regex_words \ monitor-commands "monitor command" \ @@ -518,7 +551,6 @@ _regex_words \ 'file:read rtmon-generated log:$subcmd_files' monitor_cmds=("$reply[@]") - # # Global argument handling # @@ -530,20 +562,18 @@ args=( /$'[^\0]#\0'/ ) -# TODO: -# -b*atch <FILENAME> -# -force (for batch mode) -# -l*oops <COUNT> -# -n*etns <NETNS> -# -rc, -rcvbuf<SIZE> -_regex_words options "ip options" \ - '-h*uman:output statistics with human readable values' \ +_regex_words options "ip option" \ + '-V*ersion:display version information' \ + '-h*uman-readable:output statistics with human readable values' \ + '-b*atch:read commands from specified file:$subcmd_files' \ + '-force:do not terminate on errors in batch mode' \ '-i*ec:print human readable rates in IEC units (ie. 1K = 1024)' \ '-s*tatistics:output statistics' \ '-d*etails:output more detailed information' \ '-c*olor:color output' \ '-br*ief:brief output' \ '-a*ll:executes specified command over all objects' \ + '-l*oops:specify maximum loops ip address flush logic will attempt:$subcmd_number' \ '-f*amily:select protocol family:$subcmd_family' \ '-4:IPv4' \ '-6:IPv6' \ @@ -553,9 +583,19 @@ _regex_words options "ip options" \ '-M:family MPLS' \ '-0:link protocol, no networking' \ '-o*neline:output one record per line' \ + '-j*son:output results in JSON' \ + '-p*retty:pretty print JSON' \ + '-r*esolve:use system resolver for DNS names' \ + '-n*etns:switch to specified network namespace:$subcmd_string' \ + '-N*umeric:print numbers instead of converting to text forms' \ + '-a*ll:execute specified command over all objects' \ + '-c*olor:use color output' \ '-t*imestamp:display current time when using monitor option' \ - '-ts*hort:display current time in shorter format when using monitor option' \ - '-r*esolve:use system resolver for DNS names' + '-ts*hort:like -timestamp, but use shorter format' \ + '-rc*vbuf:set the netlink socket receive buffer size:$subcmd_number' \ + '-iec:print human readable rates in IEC units' \ + '-j*son:output results in JSON format' \ + '-echo:request the kernel to send applied changes back' args+=("$reply[@]" "#") _regex_words \ @@ -566,10 +606,23 @@ _regex_words \ 'r*oute:manage routing table:$route_cmds' \ 'ru*le:manage routing policy database:$rule_cmds' \ 'n*eigh:manage neighbour/ARP tables:$neigh_cmds' \ + 'nt*able:manage the neighbor cache operation' \ 't*unnel:configure tunnel:$tunnel_cmds' \ + 'net*ns:manage network namespaces' \ + 'l2*tp:tunnel ethernet over IP (L2TPv3)' \ + 'f*ou:UDP receive port configuration' \ + 'mac*sec:MACsec device configuration' \ + 'tcp_metrics:manage TCP metrics' \ + 'token:manage tokenized interface identifiers' \ + 'netc*onf:network configuration monitoring' \ + ila ioam mptcp nexthop vrf sr stats \ 'm*addr:manage multicast addresses:$maddr_cmds' \ 'mr*oute:manage multicast routing cache:$mroute_cmds' \ - 'mo*nitor:monitor state:$monitor_cmds' + 'mru*le:multicast routing policy database' \ + 'mo*nitor:monitor state:$monitor_cmds' \ + 'tunt*ap:manage TUN/TAP devices' \ + 'x*frm:manage IPSec policies' \ + 'help' args+=("$reply[@]") _regex_arguments _ip "${args[@]}" diff --git a/Completion/Unix/Command/_jq b/Completion/Unix/Command/_jq index e8e6b0913..fb44702b2 100644 --- a/Completion/Unix/Command/_jq +++ b/Completion/Unix/Command/_jq @@ -30,7 +30,7 @@ _arguments -S -s : \ '(-r --raw-output -j --join-output)--raw-output0[like -r, with NUL after each output]' \ '(-r --raw-output --raw-output0 -j --join-output)'{-j,--join-output}"[like -r, without newlines between outputs]" \ '(-f --from-file)'{-f,--from-file}'[read filter from file]: :_files' \ - '-L+[prepend a directory to the module search path]:_directories' \ + \*{-L+,--library-path}'[prepend a directory to the module search path]:_directories' \ '(-e --exit-status)'{-e,--exit-status}'[report "false" and "null" results via exit code]' \ '*--arg[pre-set a variable to a string]:variable name: :value (string)' \ '*--argjson[pre-set a variable to an object]:variable name: :value (JSON)' \ diff --git a/Completion/Unix/Command/_ln b/Completion/Unix/Command/_ln index 05c89bac2..75e63514a 100644 --- a/Completion/Unix/Command/_ln +++ b/Completion/Unix/Command/_ln @@ -10,7 +10,7 @@ args=( ) _pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version -case $variant; in +case $variant in gnu) opts=() args=( diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index a92b91b31..5cd2e7f54 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -108,6 +108,12 @@ if ! _pick_variant gnu='(GNU|uutils)' unix --version; then '-Z[display MAC label]' ) fi + if [[ $OSTYPE = freebsd<15->.* ]]; then + arguments+=( + '(--group-directories-first)--group-directories=:order:(first last)' + '(--group-directories)--group-directories-first' + ) + fi if [[ $OSTYPE = darwin* ]]; then arguments+=( '-@[display extended attribute keys and sizes in long listing]' @@ -118,14 +124,18 @@ if ! _pick_variant gnu='(GNU|uutils)' unix --version; then '-%[distinguish dataless files and directories with a %]' ) fi - if [[ $OSTYPE = solaris* ]]; then + if [[ $OSTYPE = (aix|solaris)* ]]; then arguments+=( '(-q)-b[print octal escapes for control characters]' '(-l -1 -C -m -x)-o[long listing but without group information]' '(-l -t -s -r -a)-f[interpret each argument as a directory]' + '-H[follow symlinks on the command line]' + ) + fi + if [[ $OSTYPE = solaris* ]]; then + arguments+=( '(-E -l)-e[long listing with full and consistent date/time]' '(-e -l)-E[long listing with ISO format date/time]' - '-H[follow symlinks on the command line]' '-v[long listing with verbose ACL information]' '-V[long listing with compact ACL information]' '-@[long listing with marker for extended attribute information]' diff --git a/Completion/Unix/Command/_lsof b/Completion/Unix/Command/_lsof index 60f59a589..a6dd4a03e 100644 --- a/Completion/Unix/Command/_lsof +++ b/Completion/Unix/Command/_lsof @@ -119,7 +119,7 @@ case $state in states) if compset -P 1 '*:'; then _sequence _wanted states expl state compadd - -M 'm:{a-z}={A-Z}' \ - CLOSED IDLE BOUND LISTEN ESTABLISHED SYN_SENT SYN_RCDV ESTABLISHED \ + CLOSED IDLE BOUND LISTEN ESTABLISHED SYN_SENT SYN_RCVD \ CLOSE_WAIT FIN_WAIT1 CLOSING LAST_ACK FIN_WAIT_2 TIME_WAIT && ret=0 else compset -S ':*' || suf=( -qS : ) diff --git a/Completion/Unix/Command/_lua b/Completion/Unix/Command/_lua index 3a1ef4fd7..0a4facbe3 100644 --- a/Completion/Unix/Command/_lua +++ b/Completion/Unix/Command/_lua @@ -1,4 +1,4 @@ -#compdef lua -P lua[0-9.-]## +#compdef lua flua -P lua[0-9.-]## # Complete lua library names. We go out of our way here to support sub-modules # (of the format foo.bar.baz), even though the way `lua -l` handles those isn't diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man index 28bc12fe7..888d73895 100644 --- a/Completion/Unix/Command/_man +++ b/Completion/Unix/Command/_man @@ -76,7 +76,7 @@ _man() { [[ $variant == (freebsd)* ]] && args+=( '(: -)-h[display help information]' # @todo Could enumerate these - '-m[search manual of specified architecture]:architecture' + '-m+[search manual of specified architecture]:architecture' '-o[use non-localized man pages]' '(-a)-S+[specify manual sections to search]: :->sects' ) @@ -135,7 +135,7 @@ _man() { [[ $variant == openbsd* ]] && args+=( "(${(j< >)modes})-l+[format and display specified file]:*:::manual file:_files" # @todo Could enumerate these - '-S[search manual of specified architecture]:architecture' + '-S+[search manual of specified architecture]:architecture' ) [[ $variant == solaris* ]] && args+=( "(${(j< >)modes})-l[display file locations]" diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index bf75aa118..bdabd3791 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -293,8 +293,8 @@ if (( ! $+_fs_any )); then 'sync[do I/O synchronously]' ) _fs_cdfs=( - '(nodefperm)defperm[ignore permission bits]' - '(defperm)defperm[use permission bits]' + '(defperm)nodefperm[ignore permission bits]' + '(nodefperm)defperm[use permission bits]' 'noversion[strip off version extension]' 'rrip[use RRIP extensions]' ) diff --git a/Completion/Unix/Command/_mpc b/Completion/Unix/Command/_mpc index e3383e56d..45b181f55 100644 --- a/Completion/Unix/Command/_mpc +++ b/Completion/Unix/Command/_mpc @@ -380,7 +380,7 @@ local mpccmd="$words[1]" _arguments -C \ '(-q --quiet --no-status -v --verbose)'{-v,--verbose}'[give verbose output]' \ '(-q --quiet --no-status -v --verbose)'{-q,--quiet,--no-status}'[prevent printing song status on completion]' \ - '(-h --host)'{-h,--host=}'[connect to specified host]:_hosts' \ + '(-h --host)'{-h,--host=}'[connect to specified host]: :_hosts' \ '(-p --port)'{-p,--port=}'[connect to server port]:port' \ '(-f --format)'{-f,--format=}'[specify the format of song display]:format string:->formats' \ '(-w --wait)'{-w,--wait}'[wait for operation to finish (e.g. database update)]' \ diff --git a/Completion/Unix/Command/_mtr b/Completion/Unix/Command/_mtr index 9a73cfbd4..c5f7ea129 100644 --- a/Completion/Unix/Command/_mtr +++ b/Completion/Unix/Command/_mtr @@ -9,6 +9,7 @@ _arguments -s -S \ '(H -f --first-ttl)'{-f+,--first-ttl=}'[specify TTL to start]:TTL [1]' \ '(H -m --max-ttl)'{-m+,--max-ttl=}'[specify maximum number of hops to probe]:hops [30]' \ '(H -U --max-unknown)'{-U+,--max-unknown=}'[specify maximum unknown hosts]:maximum [5]' \ + '(H -E --max-display-path)'{-E+,--max-display-path=}'[specify maximum number of ECMP paths to display]:ECMP paths [8]' \ '(H -P --port)'{-P+,--port=}'[specify target port for TCP, SCTP or UDP]:port' \ '(H -L --localport -T --tcp -S --sctp)'{-L+,--localport=}'[specify source port number for UDP]' \ '(H -s --psize 2)'{-s+,--psize=}'[packet size]:packet size (bytes)' \ @@ -41,6 +42,8 @@ _arguments -s -S \ "I[interarrival jitter]"' \ '(H -z --aslookup -y --ipinfo)'{-y+,--ipinfo=}'[select IP information in output]:information:((0\:display\ AS\ number 1\:display\ IP\ prefix 2\:display\ country\ code 3\:display\ RIR 4\:display\ allocation\ date))' \ '(H -y --ipinfo -z --aslookup)'{-z,--aslookup}'[display AS number]' \ + '(H)--ipinfo_provider4=[specify provider for IPv4 AS lookups]:domain [origin.asn.cymru.com]' \ + '(H)--ipinfo_provider6=[specify provider for IPv6 AS lookups]:domain [origin6.asn.cymru.com]' \ '(H)1:destination host:_hosts' \ '(H)2:packet size (bytes)' \ + '(H)' \ diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv index cc33819b9..707f848c5 100644 --- a/Completion/Unix/Command/_mv +++ b/Completion/Unix/Command/_mv @@ -3,7 +3,7 @@ local args variant aopts=( -A '-*' ) _pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version -case $variant; in +case $variant in gnu) aopts=() args=( diff --git a/Completion/Unix/Command/_myrepos b/Completion/Unix/Command/_myrepos index d26c1245b..b667746e8 100644 --- a/Completion/Unix/Command/_myrepos +++ b/Completion/Unix/Command/_myrepos @@ -61,7 +61,7 @@ case $state in "offline:advise mr that it is in offline mode" "online:advise mr that it is in online mode" "remember:remember a command to be run later" - "help:display this help." + "help:display help." ) mr_alias=( diff --git a/Completion/Unix/Command/_nano b/Completion/Unix/Command/_nano new file mode 100644 index 000000000..e2333b9f4 --- /dev/null +++ b/Completion/Unix/Command/_nano @@ -0,0 +1,87 @@ +#compdef nano rnano + +local -a args context state state_descr line expl +local -A opt_args + +args=( + '(-A --smarthome)'{-A,--smarthome}'[enable smart home key]' + '(-B --backup)'{-B,--backup}'[save backups of existing files]' + '(-C --backupdir)'{-C+,--backupdir=}'[save uniquely numbered backups to specified directory]:backup directory:_directories' + '(-D --boldtext)'{-D,--boldtext}'[use bold instead of reverse video text]' + '(-E --tabstospaces)'{-E,--tabstospaces}'[convert typed tabs to spaces]' + '(-F --multibuffer)'{-F,--multibuffer}'[read file into new buffer by default]' + '(-G --locking)'{-G,--locking}'[use vim-style lock files]' + '(-H --historylog)'{-H,--historylog}'[remember search/replace strings]' + '(-I --ignorercfiles)'{-I,--ignorercfiles}"[don't look at nanorc files]" + '(-J --guidestripe)'{-J+,--guidestripe=}'[show vertical stripe at specified column]: :_numbers -l1 "column number"' + '(-K --rawsequences)'{-K,--rawsequences}'[interpret escape sequences directly instead of via ncurses]' + '(-L --nonewlines)'{-L,--nonewlines}"[don't automatically add EOF newline]" + '(-M --trimblanks)'{-M,--trimblanks}'[trim trailing whitespaces when hard-wrapping]' + '(-N --noconvert -u --unix)'{-N,--noconvert}"[don't convert files from DOS/Mac format]" + '(-O --bookstyle)'{-O,--bookstyle}'[when justifying, leading whitespace means new paragraph]' + '(-P --positionlog)'{-P,--positionlog}'[remember cursor position]' + '(-Q --quotestr)'{-Q+,--quotestr=}'[specify regular expression to match quoting]:quoting regex [^([ \t]*([!#%%\:;>|}]|//))+]' + '(-R --restricted)'{-R,--restricted}'[restrict access to the file system]' + '(-S --softwrap)'{-S,--softwrap}'[soft-wrap long lines]' + '(-T --tabsize)'{-T+,--tabsize=}'[specify tab width]: :_numbers -u columns -l1 -d8 "tab width"' + '(-c --constantshow -U --quickblank)'{-U,--quickblank}'[hide status-bar messages after next keystroke]' + '(- : *)'{-V,--version}'[display version information]' + '(-W --wordbounds -X --wordchars)'{-W,--wordbounds}'[detect word boundaries more accurately]' + '(-W --wordbounds -X --wordchars)'{-X+,--wordchars=}'[specify word characters]:word characters' + '(-Y --syntax)'{-Y+,--syntax=}'[specify syntax-highlighting definition]: :->syntaxes' + '(-Z --zap)'{-Z,--zap}'[let Backspace/Delete erase marked region]' + '(-a --atblanks)'{-a,--atblanks}'[when soft wrapping, wrap at whitespace]' + '(-b --breaklonglines -w --nowrap)'{-b,--breaklonglines}'[automatically hard-wrap long lines]' + '(-c --constantshow -U --quickblank)'{-c,--constantshow}'[constantly report cursor position in status bar]' + '(-d --rebinddelete)'{-d,--rebinddelete}'[fix Backspace/Delete confusion problem]' + '(-e --emptyline)'{-e,--emptyline}'[keep line below title bar empty]' + '(-f --rcfile)'{-f+,--rcfile=}'[use only specified file for configuring nano]:rc file:_files' + '(-g --showcursor)'{-g,--showcursor}'[show cursor in file browser and help viewer]' + '(- : *)'{-h,--help}'[display help information]' + '(-i --autoindent)'{-i,--autoindent}'[automatically indent new lines]' + '(-j --jumpyscrolling)'{-j,--jumpyscrolling}'[scroll per half-screen, not per line]' + '(-k --cutfromcursor)'{-k,--cutfromcursor}"[make 'cut text' (^k) cut from cursor to end of line]" + '(-l --linenumbers)'{-l,--linenumbers}'[show line numbers]' + '(-m --mouse)'{-m,--mouse}'[enable mouse support]' + '(-n --noread)'{-n,--noread}'[only write to named files (do not read)]' + '(-o --operatingdir)'{-o+,--operatingdir=}'[specify operating directory]:operating directory:_directories' + '(-p --preserve -/ --modernbindings)'{-p,--preserve}'[preserve XON (^q) and XOFF (^s)]' + '(-q --indicator)'{-q,--indicator}'[show position indicator (scroll bar)]' + '(-r --fill)'{-r+,--fill=}'[specify width for hard-wrap and justify]: :_numbers -u columns -Nd-8 "wrap width"' + '(-s --speller)'{-s+,--speller=}'[specify spell-checking program]:spell-checking program/command:_cmdstring' + '(-t --saveonexit)'{-t,--saveonexit}'[save changes on exit without prompting]' + '(-N --noconvert -u --unix)'{-u,--unix}'[save files by default in Unix format]' + '(-v --view)'{-v,--view}'[disallow editing (read-only mode)]' + '(-b --breaklonglines -w --nowrap)'{-w,--nowrap}"[don't hard-wrap long lines]" + '(-x --nohelp)'{-x,--nohelp}"[don't show help lines at bottom]" + '(-y --afterends)'{-y,--afterends}'[make Ctrl+Right and Ctrl+Delete stop at word ends]' + '(- : *)'{-z,--listsyntaxes}'[list names of available syntax definitions]' + '(-! --magic)'{-!,--magic}'[use libmagic to determine syntax if necessary]' + '(-@ --colonparsing)'{-@,--colonparsing}'[accept filename:linenumber notation on command line]' + '(-% --stateflags)'{-%,--stateflags}'[show state flags in title bar]' + '(-_ --minibar)'{-_,--minibar}'[hide title bar and show mini bar at bottom]' + '(-0 --zero)'{-0,--zero}'[hide UI, use whole terminal]' + '(-/ --modernbindings)'{-/,--modernbindings}'[use better-known key bindings]' + '*: :->files' +) + +_arguments -s -S : $args && ret=0 + +case $state in + syntaxes) + local -a tmp + tmp=( ${(f)"$( _call_program syntaxes $words[1] --listsyntaxes )"} ) + tmp=( ${tmp:#(#i)*available syntax*} ) + tmp=( ${(@Z<n>)tmp} ) + _wanted volume-names expl 'syntax' compadd -a - tmp && ret=0 + ;; + + files) + _alternative \ + 'line-pattern: :_guard "(|+*)" "+line[,column] or +[crCR]{/|?}pattern"' \ + 'files: :_files' \ + && ret=0 + ;; +esac + +return ret diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat index 35d639f99..256337e22 100644 --- a/Completion/Unix/Command/_netstat +++ b/Completion/Unix/Command/_netstat @@ -14,7 +14,7 @@ case $OSTYPE in linux-gnu) families=( '(-4 --inet)'{-4,--inet} - '(-6 --inet)'{-4,--inet6} + '(-6 --inet)'{-6,--inet6} '(-A --protocol)'{-A+,--protocol=}':protocol:_sequence compadd - inet inet6 unix ipx ax25 netrom ddp bluetooth' --unix -x --ip --tcpip --ax25 --x25 --rose --ash --bluetooth --ipx --netrom --ddp --appletalk --econet --ec diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 797e73eaa..243b1ac8b 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -9,10 +9,10 @@ _pandoc_format() { local format=${PREFIX%%(+|-)*} if compset -P '*(+|-)'; then local pm=${IPREFIX[-1]} # '+' or '-' - local -a extensions=(${${$(pandoc --list-extensions=$format):#$pm*}#(+|-)}) + local -a extensions=( ${${$(_call_program extensions pandoc --list-extensions=$format):#$pm*}#(+|-)} ) _wanted extensions expl 'extension' compadd -S '+' -r '-+ ' -a extensions else - local -a formats=( $(pandoc --list-$inout[2]-formats) ) + local -a formats=( $(_call_program formats pandoc --list-$inout[2]-formats) ) _wanted formats expl 'format' compadd -S '+' -r '-+ ' -a formats fi } @@ -22,15 +22,19 @@ _pandoc_format() { _pandoc_all_formats(){ local -a expl local -aU formats - formats=( $(pandoc --list-input-formats) $(pandoc --list-output-formats) ) - _wanted formats expl 'format' compadd -a formats + formats=( + $(_call_program input-formats pandoc --list-input-formats) + $(_call_program output-formats pandoc --list-output-formats) + ) + _description formats expl 'format' + compadd "$expl[@]" "$@" -a formats } # pdf engine choice (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ - 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff)' \ + 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint pagedjs-cli prince context groff pdfroff typst)' \ 'engine-executables:engine executable:_files -g "*(#q*)"' } @@ -43,7 +47,7 @@ _pandoc_pdf_engine_opts(){ _tex ;; *) - _message "Options for ${pdf_engine}" + _message "option for ${pdf_engine}" ;; esac } @@ -79,7 +83,7 @@ _pandoc_template(){ (( $+functions[_pandoc_highlight_style] )) || _pandoc_highlight_style(){ _alternative \ - 'styles:style:( $(pandoc --list-highlight-styles) )' \ + 'styles:style:( $(_call_program styles pandoc --list-highlight-styles) )' \ 'style-files:style file:_files -g "*.theme(-.)"' } @@ -195,7 +199,8 @@ _arguments -s \ '--abbreviations=[specify a custom abbreviations file]:file:_files ' \ {-s,--standalone}'[produce output with an appropriate header and footer]' \ '--template=[use specified file as a custom template for the generated document. Implies --standalone]: :_pandoc_template' \ - {\*-V+,\*--variable=}'[set the variable KEY to the value VALUE]:key\:value: ' \ + {\*-V+,\*--variable=}'[set a template variable]:key\:value' \ + \*--variable-json='[set a template variable to the value specified by a JSON string]:key\:json' \ '(- :)'{-D+,--print-default-template=}'[print the system default template for an output]:format:( $(pandoc --list-output-formats) )' \ '(- :)--print-default-data-file=[print a system default data file]:file: ' \ '--eol=[manually specify line endings (crlf|lf|native)]: :_pandoc_eol' \ @@ -217,6 +222,7 @@ _arguments -s \ '--no-check-certificate[disable the certificate verification]' \ '--self-contained[produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Implies --standalone]' \ '--embed-resources=-[produce a standalone HTML document with no external dependencies]::enable:(true false)' \ + '--link-images=-[include links to images instead of embedding the images in ODT]::enable:(true false)' \ '--html-q-tags[use <q> tags for quotes in HTML]' \ '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]' \ '--reference-links[use reference-style links, rather than inline links]' \ @@ -224,7 +230,9 @@ _arguments -s \ '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style [atx]:(setext atx)' \ '--list-tables=-[render tables as list tables in RST output]::enable(true false)' \ '--top-level-division=[treat top-level headers as given division type in LaTeX, ConTeXt, DocBook and TEI output]:top level division:(default section chapter part)' \ - {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]' \ + '(--lof --list-of-figures)'{--lof=-,--list-of-figures=-}'[include an automatically generated list of figures]::enable:(true false)' \ + '(--lot --list-of-tables)'{--lot=-,--list-of-tables=-}'[include an automatically generated list of tables]::enable:(true false)' \ + '(-N --number-sections)'{-N-,--number-sections=-}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]::enable:(true false)' \ '--number-offset=[specify offset for section headings in HTML output (ignored in other output formats)]:number[number,...] [0]' \ '--listings[use the listings package for LaTeX code blocks]' \ {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]' \ diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 7d83f90ea..57fee983c 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -36,12 +36,8 @@ args=( '*-U+[select processes by real user]:user:_sequence -s , _users' '-o+[specify output format]:property:_sequence -s , _ps_props -' - '-c[show scheduler properties]' '-f[full listing]' - '-j[show session ID and process group ID]' '-l[long listing]' - '-L[show information about each light weight process]' - '-y[show RSS in place of ADDR (used with -l)]' ) bsd=( @@ -51,15 +47,10 @@ bsd=( 'x[include processes with no controlling terminal]' '(j l s u X)v[output in virtual memory format]' '*w[wide output]' - 'L[display all format specifiers]' - 'S[include child process data with the parent]' - 'T[select processes attached to current terminal]' ) bsdarg=( '*p[select processes by ID]' '*t[select processes by attached terminal]' - 'O[specify additional output fields]' - 'o[specify output format]' ) case $OSTYPE in @@ -76,11 +67,30 @@ case $OSTYPE in '-Z[show zone with which process is associated]' ) ;; - linux-gnu|dragonfly*|freebsd*|netbsd*|openbsd*) + ^aix*) + args+=( + '-L[show information about each light weight process]' + '-c[show scheduler properties]' + '-j[show session ID and process group ID]' + '-y[show RSS in place of ADDR (used with -l)]' + ) + bsd+=( + 'L[display all format specifiers]' + 'S[include child process data with the parent]' + 'T[select processes attached to current terminal]' + ) + bsdarg+=( + 'O[specify additional output fields]' + 'o[specify output format]' + ) + ;| + linux-gnu|aix*|dragonfly*|freebsd*|netbsd*|openbsd*) bsd+=( 'e[show environment after command]' '(j l s v X)u[output in resource usage format]' ) + ;| + linux-gnu|dragonfly*|freebsd*|netbsd*|openbsd*) bsdarg+=( 'N[set namelist file for WCHAN display]' '*U[select processes by effective user]' @@ -89,10 +99,14 @@ case $OSTYPE in linux-gnu|dragonfly*|freebsd*|openbsd*) bsd+=( 'H[show threads as if they were processes]' ) ;| + aix*|darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) + bsd+=( + 'c[show just executable name for command]' + ) + ;| darwin*|dragonfly*|freebsd*|netbsd*|openbsd*) bsd+=( 'A[select every process]' - 'c[show just executable name for command]' 'h[repeat header lines, one per page of output]' '(r)m[sort by memory usage]' '(m)r[sort by CPU usage]' @@ -110,9 +124,6 @@ case $OSTYPE in darwin*|freebsd*) bsd+=( 'X[skip processes with no controlling terminal]' ) ;| - freebsd*|dragonfly*) - bsd+=( 'f[show command and environment for swapped out processes]' ) - ;| netbsd*|openbsd*) bsdarg+=( 'W[extract swap information from specified file]' ) ;| @@ -121,6 +132,26 @@ case $OSTYPE in 'd[show process hierarchy]' ) ;| + aix*) + args+=( + '-M[list 64 bit processes]' + "-N[don't gather thread statistics]" + '-L+[show process descendants]:pid list:_sequence _pids' + '-T+[show process tree rooted at given pid]:pid:_pids' + '-P[display project info]' + "-X[don't truncate user and group names]" + '-Z[display page size settings]' + '-k[list kernel processes]' + '-c+[filter by workload management class]:class list' + '-m[list kernel threads]' + ) + bsd+=( + 'g[display all processes]' + 'n[numerical output]' + 's[display kernel stack size of each process]' + "X[don't truncate user and group names]" + ) + ;| darwin*) bsd+=( 'd[select all processes except session leaders]' @@ -143,13 +174,19 @@ case $OSTYPE in fi ;; dragonfly*) - bsd+=( 'R[subsort by parent/child chain]' ) + bsd+=( + 'R[subsort by parent/child chain]' + 'f[show command and environment for swapped out processes]' + ) ;; freebsd*) bsd+=( - '*J[select processes by jail ID]' 'Z[show mac label]' ) + bsdarg+=( + 'D[expand list of selected processes based on process tree]' + '*J[select processes by jail ID]' + ) ;; netbsd*) bsd+=( '(j l u v)s[output in thread format]' ) ;; openbsd*) @@ -205,8 +242,9 @@ case $OSTYPE in ;; esac -if (( CURRENT > 1 )) && [[ $OSTYPE != (solaris*|linux-gnu) || - ( $OSTYPE = linux-gnu && $words[CURRENT-1] != -* ) ]]; then +if (( CURRENT > 1 )) && [[ $OSTYPE != (aix*|solaris*|linux-gnu) || + ( $OSTYPE = (aix*|linux-gnu) && $words[CURRENT-1] != -* ) ]] +then case $words[CURRENT-1] in *k) local sopt @@ -215,6 +253,7 @@ if (( CURRENT > 1 )) && [[ $OSTYPE != (solaris*|linux-gnu) || _sequence -s , _ps_props $sopt - && return ;; *g) [[ $OSTYPE = darwin* ]] && _wanted -C option-g-1 processes \ expl 'process ID' _sequence -s , _pids && return ;; + *D) _wanted directions expl direction compadd up down both && return ;; *G) _sequence -s , _groups && return ;; *J) _sequence _jails -0 && return ;; *[MNW]) _files && return ;; diff --git a/Completion/Unix/Command/_pv b/Completion/Unix/Command/_pv index 0e1f148d5..4bec330a6 100644 --- a/Completion/Unix/Command/_pv +++ b/Completion/Unix/Command/_pv @@ -17,7 +17,6 @@ _arguments -s -S $args \ '(-I --fineta -F --format)'{-I,--fineta}'[show absolute estimated time of arrival]' \ '(-r --rate -F --format)'{-r,--rate}'[show data transfer rate counter]' \ '(-a --average-rate -F --format)'{-a,--average-rate}'[show data transfer average rate counter]' \ - '(-m --average-rate-window)'{-m+,--average-rate-window=}'[compute average rate over period]:duration (seconds) [30]' \ '(-b --bytes -8 --bits -F --format)'{-b,--bytes}'[show number of bytes transferred]' \ '(-8 --bits -b --bytes -F --format)'{-8,--bits}'[show number of bits transferred]' \ '(-k --si)'{-k,--si}'[treat suffixes as multiples of 1000 rather than 1024]' \ @@ -33,10 +32,11 @@ _arguments -s -S $args \ '(-l --line-mode -R --remote)'{-l,--line-mode}'[count lines instead of bytes]' \ '(-0 --null -l --line-mode)'{-0,--null}'[lines are null-terminated]' \ '(-i --interval)'{-i+,--interval=}'[update every after specified interval]:interval (seconds) [1]' \ - '(-m --average-rate-window)'{-m,--average-rate-window}'[compute average rate over past period]:period (seconds) [30]' \ + '(-m --average-rate-window)'{-m,--average-rate-window}'[compute average rate over period]:period (seconds) [30]' \ '(-w --width)'{-w+,--width}'[assume terminal is specified characters wide]:width' \ '(-H --height)'{-H+,--height=}'[assume terminal is specified rows high]:height' \ '(-N --name)'{-N+,--name=}'[prefix visual information with given name]:name' \ + '(-u --bar-style)'{-u+,--bar-style=}'[set default bar style]:name [plain]:(plain block granular shaded)' \ '(-x --extra-display)'{-x+,--extra-display=}'[also send progress to destination]:destination:_sequence - compadd windowtitle processtitle' \ '(-v --stats)'{-v,--stats}'[output transfer statistics at the end]' \ '(-f --force -R --remote)'{-f,--force}'[output even if standard error is not a terminal]' \ @@ -70,6 +70,8 @@ case $state in 'a:average data transfer rate' 'b:bytes transferred so far' 'T:percentage of transfer buffer in use' + 'A:last written' + 'L:previous line' 'N:name prefix' '%:literal %' ) diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm index cc2e456b5..4575e4dc4 100644 --- a/Completion/Unix/Command/_rm +++ b/Completion/Unix/Command/_rm @@ -9,7 +9,7 @@ args=( '*:: :->file' ) _pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version -case $variant; in +case $variant in gnu) opts=() args+=( diff --git a/Completion/Unix/Command/_rmdir b/Completion/Unix/Command/_rmdir index 029fa5b85..deb244abb 100644 --- a/Completion/Unix/Command/_rmdir +++ b/Completion/Unix/Command/_rmdir @@ -8,7 +8,7 @@ args=( ) _pick_variant -r variant -b zsh gnu='(GNU|uutils)' $OSTYPE --version -case $variant; in +case $variant in gnu) aopts=() args+=( diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index 1657d411e..d6748f0f5 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -209,9 +209,9 @@ _rsync() { '--force-change[affect user-/system-immutable files/dirs]' \ '--force-uchange[affect user-immutable files/dirs]' \ '--force-schange[affect system-immutable files/dirs]' \ - "--max-delete=[don't delete more than NUM files]: :_numbers -f -u bytes size B K M G T P" \ + "--max-delete=[don't delete more than the specified number of files]:number" \ "--max-size=[don't transfer any file larger than specified size]: :_numbers -f -u bytes size B K M G T P" \ - '--min-size=[do not transfer any file smaller than specified size]:number' \ + "--min-size=[don't transfer any file smaller than specified size]: :_numbers -f -u bytes size B K M G T P" \ '--max-alloc=[set limit to individual memory allocation]: :_numbers -f -u bytes -d 1g size B K M G T P' \ '(-P)--partial[keep partially transferred files]' \ '--no-partial[turn off --partial]' \ @@ -278,8 +278,8 @@ _rsync() { '(--usermap --groupmap --chown)--chown=[simple username/groupname mapping]:user and/or group:_rsync_users_groups' \ '*'{-M+,--remote-option=}'[send option to the remote side only]:option string' \ '--preallocate[preallocate the full length of new files]' \ - '--iconv=[request charset conversion of filenames]:number' \ - '--checksum-seed=:number' \ + '--iconv=[request charset conversion of filenames]:convert specification' \ + '--checksum-seed=[set checksum seed (advanced)]:number' \ '--read-batch=[read a batched update from the specified file]:file:_files' } diff --git a/Completion/Unix/Command/_sed b/Completion/Unix/Command/_sed index ecbec61d1..262628155 100644 --- a/Completion/Unix/Command/_sed +++ b/Completion/Unix/Command/_sed @@ -88,7 +88,7 @@ elif _pick_variant -r variant gnu=GNU unix --version; then 'v:fail if GNU extensions not supported or older than specified version' ) cmds_end+=( - "e:execute a command and include it's output" + "e:execute a command and include its output" 'F:print the filename of the current input file' 'Q:quit' 'z:empty the pattern space' diff --git a/Completion/Unix/Command/_service b/Completion/Unix/Command/_service index 28563429b..5f9ca0d67 100644 --- a/Completion/Unix/Command/_service +++ b/Completion/Unix/Command/_service @@ -11,14 +11,18 @@ zstyle -T ":completion:${ctx}" tag-order && \ case $OSTYPE in freebsd<14->.*) - args=( '-E+[set environment variable before executing the rc.d script]:variable:_parameters -g "*export*~*readonly*" -S=' ) + args=( + '(-l -r)-d[enable debugging of rc.d scripts]' + '-E+[set environment variable before executing the rc.d script]:variable:_parameters -g "*export*~*readonly*" -S=' + '(-l -r)-q[quiet]' + ) ;& freebsd<11->.*) args+=( '-j+[perform actions in specified jail]:jail:_jails' ) ;& freebsd*|dragonfly*) actions=( - '(*)-r[show the results of boot time rcorder]' + '(* -q -d)-r[show the results of boot time rcorder]' '(*)-R[restart all enabled local services]' ) ;& @@ -28,7 +32,7 @@ case $OSTYPE in '*::service argument:_init_d' \ + '(actions)' $actions \ '(*)-e[show services that are enabled]' \ - '(*)-l[list all scripts in /etc/rc.d and the local startup directory]' \ + '(* -q -d)-l[list all scripts in /etc/rc.d and the local startup directory]' \ ':service name:_services' ;; *) diff --git a/Completion/Unix/Command/_sort b/Completion/Unix/Command/_sort index 90827de4f..ac808a6d4 100644 --- a/Completion/Unix/Command/_sort +++ b/Completion/Unix/Command/_sort @@ -45,7 +45,6 @@ case $variant in "$ordering"{-R,--random-sort}'[sort by random hash of keys]' "$ordering"{-V,--version-sort}'[sort version numbers]' "$ordering--sort=[specify comparator]:comparator:(general-numeric human-numeric month numeric random version)" - '(-i --ignore-nonprinting)'{-i,--ignore-nonprinting}'[consider only printable characters]' '--random-source=[get random bytes from file]:file:_files' '--batch-size=[maximum inputs to merge]:number' '--compress-program=[specify program to compress temporary files with]:program:(gzip bzip2 lzop xz)' diff --git a/Completion/Unix/Command/_sqlite b/Completion/Unix/Command/_sqlite index a83624083..218b92b4a 100644 --- a/Completion/Unix/Command/_sqlite +++ b/Completion/Unix/Command/_sqlite @@ -47,6 +47,7 @@ options+=( $^dashes'-bail[stop after hitting an error]' $^dashes'-cmd[run specified command before reading stdin]:sqlite meta-command' $^dashes'-deserialize[open the database using sqlite3_deserialize()]' + $^dashes'-escape[set rendering of control characters in output]:escape [ascii]:(symbol ascii off)' '(-*batch -*interactive)'$^dashes'-batch[force batch I/O]' '(-*batch -*interactive)'$^dashes'-interactive[force interactive I/O]' $^dashes'-lookaside[specify size and number of entries for lookaside memory]:size (bytes): :entries' diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index e2889c71a..d3f800610 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -79,7 +79,7 @@ _svn () { usage=${${(M)${(f)"$(_call_program options svn help $dash_v -- $cmd)"}:#usage:*}#usage:*$cmd] } _store_cache svn-${cmd}-usage usage fi - if _cache_invalid svn-${cmd}-usage || \ + if _cache_invalid svn-${cmd}-args || \ ! _retrieve_cache svn-${cmd}-args; then args=( @@ -119,7 +119,7 @@ _svn () { _store_cache svn-${cmd}-args args fi - case $cmd in; + case $cmd in (add) args+=( '*:file: _svn_modified "addable"' diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index c334c6765..33a9d6c0c 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -52,7 +52,7 @@ else '(--preserve-env -i --login -s --shell -e --edit)-E[preserve user environment when running command]' \ '(-E -i --login -s --shell -e --edit)--preserve-env=-[preserve user environment when running command]::environment variable:_sequence _parameters -g "*export*"' \ '(-H --set-home -i --login -s --shell -e --edit)'{-H,--set-home}"[set HOME variable to target user's home dir]" \ - '(-P --preserve-groups -i -login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ + '(-P --preserve-groups -i --login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ '*:: :->normal' ) fi @@ -85,7 +85,7 @@ if [[ $state = normal ]]; then 'options:option:(-s --shell -l --login)' \ 'parameters: :_parameters -g "*export*~*readonly*" -qS=' && ret=0 else - _normal + _normal && ret=0 fi fi diff --git a/Completion/Unix/Command/_tex b/Completion/Unix/Command/_tex index 1a70b5058..c5f0c370c 100644 --- a/Completion/Unix/Command/_tex +++ b/Completion/Unix/Command/_tex @@ -24,6 +24,6 @@ _arguments : \ '-src-specials=-[insert source specials in certain places of the DVI file]:WHERE:_values -s , WHERE cr display hbox math par parend vbox' \ '-translate-file=-[use the TCX file TCXNAME]:TCXNAME:' \ '-8bit[make all characters printable by default]' \ - '-help[display this help and exit]' \ + '-help[display help and exit]' \ '-version[output version information and exit]' \ '*:TeX or LaTeX file:_files -g "*.(tex|TEX|texinfo|texi|dtx)(-.)"' diff --git a/Completion/Unix/Command/_timeout b/Completion/Unix/Command/_timeout index f1961012d..676f8e8cd 100644 --- a/Completion/Unix/Command/_timeout +++ b/Completion/Unix/Command/_timeout @@ -11,9 +11,9 @@ local args ) _arguments -S -A "-" $args \ - '--preserve-status[always exit with the same status as command even if it times out]' \ - "--foreground[don't propagate timeout to the command children]" \ + '(-p --preserve-status)'{-p,--preserve-status}'[always exit with the same status as command even if it times out]' \ + '(-f --foreground)'{-f,--foreground}"[don't propagate timeout to the command children]" \ '(-s --signal)'{-s,--signal}'[specify the signal to send on timeout]:signal:_signals' \ - '(-k --kill-after)'{-k,--kill-after}'[followup first signal with SIGKILL if command persists after specified time]:time' \ + '(-k --kill-after)'{-k+,--kill-after=}'[followup first signal with SIGKILL if command persists after specified time]: :_numbers -f -u seconds duration \:s\:seconds m\:minutes h\:hours d\:days' \ '1: :_numbers -f -u seconds duration :s:seconds m:minutes h:hours d:days' \ '*:::command: _normal -p $service' diff --git a/Completion/Unix/Command/_tmux b/Completion/Unix/Command/_tmux index b9c220f17..80c69d2fb 100644 --- a/Completion/Unix/Command/_tmux +++ b/Completion/Unix/Command/_tmux @@ -567,7 +567,7 @@ _tmux-list-windows() { [[ -n ${tmux_describe} ]] && print "list windows of a session" && return _arguments -s \ '-a[list all windows the tmux server possesses]' \ - '-F[specify output format]:format:__tmux-formats' \ + '-F+[specify output format]:format:__tmux-formats' \ '-f+[filter items]:filter format:__tmux-formats' \ '-t+[specify session]:session:__tmux-sessions' } @@ -764,7 +764,7 @@ _tmux-respawn-pane() { '-c+[specify a new working directory for the pane]:directory:_directories' \ '*-e[specify environment variable]:environment variable:_parameters -g "*export*" -qS=' \ '-k[kill window if it is in use]' \ - '-t+[specify target pane]:pane:__tmux-pane' \ + '-t+[specify target pane]:pane:__tmux-panes' \ ':command:_cmdambivalent' } @@ -886,7 +886,7 @@ _tmux-server-access() { } _tmux-set-buffer() { - [[ -n ${tmux_describe} ]] && print "set contents of a paster buffer" && return + [[ -n ${tmux_describe} ]] && print "set contents of a paste buffer" && return _arguments -s -A "-*" -S \ '-a[append to rather than overwriting target buffer]' \ '-b+[specify target buffer index]:pane:__tmux-buffers' \ @@ -999,7 +999,7 @@ _tmux-show-hooks() { _tmux-show-buffer() { [[ -n ${tmux_describe} ]] && print "display the contents of a paste buffer" && return - _arguments '-b[specify target buffer index]:pane:->buffer' + _arguments '-b[specify target buffer index]:buffer:__tmux-buffers' } _tmux-show-environment() { @@ -1648,16 +1648,22 @@ function __tmux-session-options() { 'display-panes-active-colour:colour for active pane in display-panes' 'display-panes-time:time (in msecs) of display-panes output' 'display-time:time (in msecs) messages are displayed' + 'focus-follows-mouse:select panes when the mouse enters them' 'history-limit:number of copy-mode lines per window' + 'initial-repeat-time:initial repeat-key timeout' 'key-table:default key table' 'lock-after-time:lock sessions after N seconds' 'lock-command:command to run for locking a client' 'message-command-style:status line message command style' + 'message-format:prompt and message area format' 'message-line:status message and command prompt position' 'message-style:status line message style' 'mouse:enable mouse support' 'prefix:primary prefix key' 'prefix2:secondary prefix key' + 'prompt-command-cursor-style:cursor style in vi prompt command mode' + 'prompt-cursor-colour:prompt cursor colour' + 'prompt-cursor-style:prompt cursor style' 'renumber-windows:renumber windows if a window is closed' 'repeat-time:time for multiple commands without prefix-key presses' 'set-titles:try to set xterm window titles' @@ -1729,22 +1735,29 @@ function __tmux-server-options() { tmux_server_options=( 'backspace:set key sent by tmux for backspace' 'buffer-limit:number of buffers kept per session' + 'codepoint-widths:list of override widths for Unicode codepoints' 'command-alias:custom command aliases' 'copy-command:specify the default command when "copy-pipe" is called without arguments' + 'default-client-command:default tmux command with no subcommand' 'default-terminal:default terminal definition string' 'escape-time:set timeout to detect single escape characters (in msecs)' 'editor:specify the command used when tmux runs an editor' 'exit-unattached:make server exit if it has no attached clients' 'exit-empty:exit when there are no active sessions' 'extended-keys:control whether tmux will send extended keys through to the terminal' + 'extended-keys-format:extended-key output format' 'focus-events:request focus events from terminal' + 'get-clipboard:how tmux answers clipboard requests' 'history-file:tmux command history file name' + 'input-buffer-size:input bytes allowed before dropping' 'message-limit:set size of message log per client' + 'prefix-timeout:prefix-key timeout' 'prompt-history-limit:set the number of history items to save in the history file' 'set-clipboard:use esc sequences to set terminal clipboard' 'terminal-features:set terminal features not detected by terminfo' 'terminal-overrides:override terminal descriptions' 'user-keys:set list of user-defined key escape sequences' + 'variation-selector-always-wide:treat Unicode VS16 as always wide' ) _describe -t tmux-server-options 'tmux server option' tmux_server_options } @@ -1800,6 +1813,7 @@ function __tmux-window-options() { 'aggressive-resize:aggressively resize windows' 'allow-passthrough:allow programs in the pane to bypass tmux' 'allow-rename:allow programs to change window titles' + 'allow-set-title:allow apps to set pane titles' 'alternate-screen:allow alternate screen feature to be used' 'automatic-rename-format:format for automatic renames' 'automatic-rename:attempt to automatically rename windows' @@ -1808,6 +1822,9 @@ function __tmux-window-options() { 'copy-mode-current-match-style:set the style of the current search match in copy mode' 'copy-mode-mark-style:set the style of the line containing the mark in copy mode' 'copy-mode-match-style:set the style of search matches in copy mode' + 'copy-mode-position-format:format for the position indicator in copy mode' + 'copy-mode-position-style:style for position indicator in copy mode' + 'copy-mode-selection-style:style for selection in copy mode' 'cursor-colour:set the colour of the cursor' 'cursor-style:set the style of the cursor' 'fill-character:set the character used to fill unused window areas' @@ -1832,13 +1849,21 @@ function __tmux-window-options() { 'pane-border-status:turn border status off or set its position' 'pane-border-style:style of border pane' "pane-colours:an array used to configure tmux's colour palette" + 'pane-scrollbars:pane scrollbar visibility mode' + 'pane-scrollbars-position:side used for pane scrollbars' + 'pane-scrollbars-style:pane scrollbar style' + 'pane-status-current-style:current pane status-line style' + 'pane-status-style:pane status-line style' 'popup-border-lines:set the type of line used to draw popup borders' "popup-border-style:set the style for the popup's border" 'popup-style:set the popup style' "remain-on-exit:don't destroy windows after the program exits" "remain-on-exit-format:set the text shown at bottom of exited panes" 'scroll-on-clear:scroll previous contents into history before clear' + 'session-status-current-style:current session status-line style' + 'session-status-style:session status-line style' 'synchronize-panes:send input to all panes of a window' + 'tiled-layout-max-columns:column limit for the tiled layout' 'window-active-style:style of active window' 'window-size:indicate how to automatically size windows' 'window-status-activity-style:style of status bar activity tag' diff --git a/Completion/Unix/Command/_tree b/Completion/Unix/Command/_tree index 595249126..fdb22a9c9 100644 --- a/Completion/Unix/Command/_tree +++ b/Completion/Unix/Command/_tree @@ -1,22 +1,29 @@ #compdef tree +# tree has its own weird option-parsing method that requires arguments to short +# options to appear in the next word... except for -L (as of 2.2.1) _arguments -s -S \ '-a[show all files, including hidden ones]' \ '-d[list directories only]' \ '-l[follow symlinks that point to directories]' \ '-f[print full path prefix for each file]' \ '-x[stay on current filesystem]' \ - '-L[specify max tree depth to descend]:level' \ + '-L+[specify max tree depth to descend]: :_numbers -l1 depth' \ '-R[recursively cross down the tree and execute tree again]' \ - '-P[only list files matching a pattern]:pattern:_files' \ - "-I[don't list files matching a pattern]:pattern:_files" \ + '-P[only list files matching specified pattern]:pattern:_files' \ + "-I[don't list files matching specified pattern]:pattern:_files" \ + '--gitignore[respect .gitignore files for filtering]' \ + '*--gitfile=[use specified file as gitignore file]:gitignore file:_files' \ '--ignore-case[ignore case when pattern matching]' \ '--matchdirs[include directory names in -P pattern matching]' \ + '--metafirst[print file meta-data at beginning of line]' \ + '--info[print file comments found in .info files]' \ + '*--infofile=[use specified file as info file]:info file:_files' \ '--noreport[omit file and directory report at end]' \ - '--charset=[character set for HTML and for line drawing]:charset' \ - "--filelimit=[don't descend directories with more than specified number of entries]:entries" \ - '--timefmt=[use specified time format]:format:_date_formats' \ - '-o[output to specified file]:file:_files' \ + '--charset=[specify character set for HTML and line drawing]:charset' \ + "--filelimit=[don't descend directories with more than specified number of entries]: :_numbers entries" \ + '--timefmt=[use specified time format]: :_date_formats' \ + '-o[output to specified file]: :_files' \ '--du[print directory sizes]' \ '--prune[exclude empty directories from the output]' \ '(-N)-q[print non-printable characters as question mark, not caret]' \ @@ -32,24 +39,33 @@ _arguments -s -S \ '-F[append descriptive character to end, like ls -F]' \ '--inodes[print inode numbers]' \ '--device[print device number to which file or directory belongs]' \ - '(--sort -t -c -U)-v[sort the output as version]' \ + '(--sort -t -c -U)-v[sort output as version]' \ '(-v --sort -c -U)-t[sort output by modification time]' \ '(-v --sort -t -U)-c[sort output by change time]' \ '(-v --sort -t -c -r --dirsfirst)-U[leave files unsorted]' \ '(-U)-r[sort in reversed order]' \ - '(-v -t -c -U)--sort[sort in specified order]:order:(name version size mtime ctime)' \ - '(-U)--dirsfirst[list directories before files]' \ + '(-v -t -c -U)--sort=[sort in specified order]:order:(name version size mtime ctime none)' \ + '(-U --filesfirst)--dirsfirst[list directories before files]' \ + '(-U --dirsfirst)--filesfirst[list files before directories]' \ "-i[don't print indentation lines]" \ - '(-S -X)-A[use ANSI line graphics hack when printing indentation lines]' \ - '(-A -X)-S[use console (CP437) line graphics]' \ - '(-C)-n[turn colorization off always, over-ridden by the -C option]' \ + '(-S -H -J -X)-A[use ANSI line graphics hack when printing indentation lines]' \ + '(-A)-S[equivalent to --charset=IBM437]' \ + '(-C)-n[turn colorization off always]' \ '(-n)-C[turn colorization on always]' \ - '(-A -S -n -C -J -H -T --nolinks)-X[XML output]' \ - '(-A -S -n -C -X -H -T --nolinks)-J[JSON output]' \ - '(-n -C -X)-H[turn on HTML output]:base HREF' \ - '(-n -C -X)-T[title for HTML output]:title' \ - '(-n -C -X)--nolinks[turn off hyperlinks in HTML output]' \ - '--fromfile[read paths from specified files]' \ - '(-)--version[version of tree]' \ - '(-)--help[verbose usage listing]' \ - '*:directory:_files -/' + '(-A -J -H -T --nolinks)-X[turn on XML output]' \ + '(-A -X -H -T --nolinks)-J[turn on JSON output]' \ + '(-A -J -X)-H[turn on HTML output]:base HREF' \ + '(-A -J -X)--hintro=[use specified file as HTML intro]:HTML intro file:_files' \ + '(-A -J -X)--houtro=[use specified file as HTML outro]:HTML outro file:_files' \ + '(-A -J -X)-T[specify title for HTML output]:title' \ + '(-A -J -X --hyperlink)--nolinks[turn off hyperlinks in HTML output]' \ + '(-H -J -X --nolinks)--hyperlink[turn on OSC 8 hyperlinks]' \ + '(-H -J -X --nolinks)--scheme=[specify schema used for OSC 8 hyperlinks]:schema [file\://]' \ + '(-H -J -X --nolinks)--authority=[specify authority (host name) used for OSC 8 hyperlinks]: :_hosts' \ + '(--fromtabfile)--fromfile[read paths from specified files]:paths file:_files' \ + '(--fromfile)--fromtabfile[read tab-indented paths from specified files]:paths file:_files' \ + '--fflinks[process symbolic link information with in files (with --from*file)]' \ + '--opt-toggle[turn on option toggling]' \ + '(- :)--version[display version information]' \ + '(- :)--help[display help information]' \ + '*: :_directories' diff --git a/Completion/Unix/Command/_wget b/Completion/Unix/Command/_wget index acc8d5c6e..4e49193c8 100644 --- a/Completion/Unix/Command/_wget +++ b/Completion/Unix/Command/_wget @@ -55,7 +55,7 @@ _arguments -C -s \ '--prefer-family=[connect first to addresses of specified family]:address family:(IPv6 IPv4 none)' \ '(--http-user --ftp-user)--user[set both ftp and http user]:user' \ '(--http-password --ftp-password)--password[set both ftp and http password]:password' \ - '(--password --http-password --ftp-password)--ask-password:[prompt for passwords]' \ + '(--password --http-password --ftp-password)--ask-password[prompt for passwords]' \ '--use-askpass=:command:_command_names -e' \ '--no-iri[turn off IRI support]' \ '--local-encoding=[specify local encoding for IRIs]:encoding' \ @@ -105,7 +105,7 @@ _arguments -C -s \ '--certificate=[specify client certificate]:client certificate file:_files' \ '--certificate-type=[specify client certificate type]:certificate type:(PEM DER)' \ '--private-key=[specify private key file]:key file:_files' \ - '--private-key-type=[specify private key type]:key type:key type:(PEM DER)' \ + '--private-key-type=[specify private key type]:key type:(PEM DER)' \ "--ca-certificate=[specify file with bundle of CA's]:file:_files" \ "--ca-directory=[specify dir where hash list of CA's are stored]:directory:_directories" \ '--crl-file=[specify file with bundle of CRLs]:file:_files' \ diff --git a/Completion/Unix/Command/_zdump b/Completion/Unix/Command/_zdump index f96bdd764..9e71a5f53 100644 --- a/Completion/Unix/Command/_zdump +++ b/Completion/Unix/Command/_zdump @@ -1,6 +1,26 @@ #compdef zdump -_arguments \ - '-v[lowest possible]' \ - '-c[cutoff]:cutoff year:' \ +local -a args + +case $OSTYPE in + aix*|(net|free)bsd*|linux*|solaris*) + args+=( '(-)--version[display version information]' ) + ;| + aix*|(net|free)bsd*|linux*) + args+=( '(-)--help[display usage information]' ) + ;| + (net|free)bsd*|linux*) + args+=( '-i[output a description of time intervals]' ) + ;| + aix*|(free|net|open)bsd*|linux*) + args+=( + '(-c)-t[cut off interval output at the given times]:cut off (seconds since epoch)' + '(-v)-V[like -v, but omit times relative to the extreme time values]' + ) + ;| +esac + +_arguments -S $args \ + '(-V)-v[print time at lowest possible time value]' \ + '(-t)-c[cut off interval output at the given years]:cutoff years [-500,2500]' \ '*:time zone:_time_zone' diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index dd67ea767..3a884439b 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -69,6 +69,8 @@ rw_ds_props=( 'compression:value:($comp_algorithms)' 'copies:value:(1 2 3)' 'dedup:value:($dedup_algorithms)' + 'defaultuserquota:->quotas' + 'defaultgroupquota: :->quotas' 'devices:value:(on off)' 'encryption:value:(off on aes128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm)' 'exec:value:(on off)' @@ -79,7 +81,7 @@ rw_ds_props=( 'paths:mountpoint:_directories -W / -P /'" 'multilevel:value:(on off)' 'nbmand:value:(on off)' - {prefetch,primarycache}':value:(all none metadata)' + {prefetch,primarycache,secondarycache}':value:(all none metadata)' 'quota: :->quotas' 'readonly:value:(on off)' 'recordsize:value:(512 1K 2K 4K 8K 16K 32K 64K 128K 256K 512K 1M)' @@ -89,7 +91,6 @@ rw_ds_props=( 'properties:property:(auto none)'" 'reservation: :->quotas' 'rstchown:value:(on off)' - 'secondarycache:value:(all none metadata)' 'setuid:value:(on off)' 'shadow:value' # TODO: complete URI|none 'share:share properties' @@ -128,9 +129,11 @@ case $service:$implementation in 'bcloneused[amount of storage used by cloned blocks]' 'dedup_table_size[size of dedup table on-disk]' 'dedupcached[size of dedup table in arc]' + 'encryptionroot' 'expandsize[uninitialized space within the pool]' 'fragmentation[amount of fragmentation in the pool]' 'freeing[amount of space remaining to be reclaimed]' + 'last_scrubbed_txg[transaction group (TXG) up to which the most recent scrub operated]' 'load_guid[unique identifier generated when pool is loaded]' 'used[amount of storage space used within the pool]' ) @@ -150,8 +153,20 @@ case $service:$implementation in rw_ds_props+=( 'aclmode:value:(discard groupmask passthrough restricted)' 'acltype:value:(off noacl nfsv4 posix posixacl)' + 'defaultprojectquota:->quotas' + 'defaultprojectobjquota:->quotas' + 'defaultgroupobjquota:->quotas' + 'defaultuserobjquota:->quotas' + 'dnodesize:value:(legacy auto 1k 2k 4k 8k 16k)' + 'direct:value:(disabled standard always)' + 'groupobjquota@' 'mlslabel:value:(none)' # TODO: list sensitivity labels - 'redundant_metadata:value:(all most)' + 'overlay:value:(on off)' + 'projectquota@' 'projectobjquota@' + 'redundant_metadata:value:(all most some none)' + 'snapdev:value:(hidden visible)' + 'special_small_blocks:size [0]' + 'userobjquota@' 'vscan:value:(on off)' 'xattr:value:(on off dir sa)' "filesystem_limit: :{if [[ -prefix [0-9]## ]]; then _message -e 'number'; elif [[ -prefix n ]]; then compadd none; else _message -e limits 'number or none'; fi}" @@ -166,8 +181,8 @@ case $service:$implementation in ) ro_ds_props+=( createtxg clones filesystem_count guid logicalreferenced logicalused - receive_resume_token refcompressratio snapshot_count snapshots_changed - volblocksize written + objsetid receive_resume_token redact_snaps refcompressratio + snapshot_count snapshots_changed volblocksize written ) delegatable_perms=( bookmark load-key change-key userobjquota userobjused groupobjquota @@ -240,8 +255,6 @@ case $service:$implementation in "defaultwritelimit: : _alternative \ 'sizes: :_guard \[0-9\]\#\(\|\[BKMGTPEZ\]\) size\ \(bytes\ per\ second\)' \ 'properties:property:(none)'" - 'defaultuserquota:->quotas' - 'defaultgroupquota: :->quotas' 'keysource:value:->keysources' ) ci_ds_props+=( @@ -256,13 +269,13 @@ case $service:$implementation in zfs:openzfs) subcmds+=( bookmark change-key load-key program project projectspace redact - unload-key wait + rewrite unload-key wait version ) ;| zpool:openzfs) subcmds+=( - checkpoint events labelclear initialize reopen resilver sync trim wait - version + checkpoint events labelclear initialize reopen resilver sync prefetch + trim wait version ) ;| zfs:solaris) @@ -282,8 +295,9 @@ case $service:$implementation in ;; zpool:*) subcmds+=( - add attach clear create destroy detach export get history import iostat - list offline online reguid remove replace scrub set split status upgrade + add attach clear create destroy ddtprune detach export get history + import iostat list offline online reguid remove replace scrub set + split status upgrade ) ;; zstream:*) @@ -292,15 +306,18 @@ case $service:$implementation in esac case $OSTYPE in - solaris*) + solaris*|linux-gnu) rw_ds_props+=( 'zoned:value:(on off)' ) - ;; + ;| freebsd*) [[ $OSTYPE = freebsd<-12>.* ]] && subcmds+=( remap ) rw_ds_props+=( 'jailed:value:(on off)' ) ;; linux-gnu) - rw_ds_props+=( 'relatime:value:(on off)' ) + rw_ds_props+=( + 'relatime:value:(on off)' + 'volthreading:value:(on off)' + ) ci_ds_props+=( {,fs,def,root}'context:SELinux context:_selinux_contexts -a file_type' ) @@ -508,7 +525,11 @@ case $service:$words[1] in if [[ $implementation = solaris ]]; then args=( '-I+[specify dataset states to display instead of normal datasets]:dataset state:_sequence compadd - receiving resumable hidden all' ) else - args=( '-p[use exact (parsable) numeric output]' ) + args=( + '(-j --json)'{-j,--json}'[output in JSON format]' + '--json-int[output numbers in integer format instead of strings]' + '-p[use exact (parsable) numeric output]' + ) fi _arguments -A "-*" -S $args \ '(-d)-r[recursively display children]' \ @@ -604,6 +625,17 @@ case $service:$words[1] in '*:file:_files' ;; + zfs:rewrite) + _arguments -A "-*" -S -s \ + '-P[rewrite physical blocks only so snapshots and incremental streams are unaffected]' \ + '-l+[specify maximum number of bytes to write]:maximum (bytes)' \ + '-o+[specify starting offset]:offset (bytes)' \ + '-r[recurse into directories]' \ + '-v[print names of all successfully rewritten files]' \ + "-x[don't cross file system boundaries]" \ + '*:file or directory:_files' + ;; + zfs:mount) [[ $OSTYPE != freebsd* ]] && args=( '-O[overlay mount]' ) [[ $implementation = openzfs ]] && args+=( @@ -611,6 +643,7 @@ case $service:$words[1] in '(-a)-R[mount filesystems along with all their children]' ) _arguments -A "-*" -S $args \ + '(- :)'{-j,--json}'[show all mounted file systems in JSON format]' \ '-o+[specify temporary file system options]: :_values -s , "option" {,no}{atime,dev,exec,relatime,suid,xattr} ro rw' \ '-v[report mount progress]' \ '-f[force mount]' \ @@ -898,6 +931,11 @@ case $service:$words[1] in ':property:($delegatable_perms $ro_ds_props ${rw_ds_props%%:*})' ;; + (zfs|zpool):version) + _arguments -A "-*" -S \ + '-j[output in JSON format]' + ;; + zpool:(clear|online)) [[ $OSTYPE = linux* ]] && args=( "--power[power on the device's slot in the storage enclosure]" @@ -991,6 +1029,13 @@ case $service:$words[1] in '*: :->virtual-devices' ;; + zpool:ddtprune) + _arguments -A "-*" -S \ + '(-p)-d[prune entries based on age]:age (days)' \ + '(-d)-p[prune to target percentage of unique entries]:target (percentage)' \ + ':pool:_zfs_pool' + ;; + zpool:destroy) _arguments -A "-*" -S \ '-f[force active datasets to be unmounted]' \ @@ -1020,9 +1065,17 @@ case $service:$words[1] in ;; zpool:get) - [[ $implementation = solaris ]] && args=( - '-s+[specify sources to display]: :_values -s , "source" local default none' - ) + if [[ $implementation = openzfs ]]; then + args=( + '(-j --json)'{-j,--json}'[output in JSON format]' + '--json-int[output numbers in integer format instead of strings]' + --json-pool-key-guid + ) + else + args=( + '-s+[specify sources to display]: :_values -s , "source" local default none' + ) + fi _arguments -A "-*" -S $args \ '-H[suppress headers and tab-delimit fields]' \ '-p[display numbers in parseable (exact) values]' \ @@ -1076,6 +1129,7 @@ case $service:$words[1] in zpool:initialize) _arguments -A "-*" -S \ + '(-a --all : *)'{-a,--all}'[begin, cancel, suspend initializing on all pools]' \ '(-s --suspend -c --cancel)'{-c,--cancel}'[cancel initializing on specified devices]' \ '(-s --suspend -c --cancel)'{-s,--suspend}'[suspend initializing on specified devices]' \ '(-u --uninit)'{-u,--uninit}'[clear initialization state on specified devices]' \ @@ -1130,6 +1184,9 @@ case $service:$words[1] in zpool:list) [[ $implementation = openzfs ]] && args=( '-g[display vdev GUIDs instead of normal device names]' + '(-j --json)'{-j,--json}'[output in JSON format]' + '--json-int[output numbers in integer format instead of strings]' + --json-pool-key-guid '-L[display real paths for vdevs resolving all symbolic links]' '-p[display numbers in parsable (exact) values]' '-P[display full paths for vdevs instead of only the last component of the path]' @@ -1167,12 +1224,21 @@ case $service:$words[1] in ;; zpool:online) - _arguments -C -A "-*" -S $args \ + _arguments -C -A "-*" -S \ '-e[expand device to use all available space]' \ ':pool:_zfs_pool' \ '*:virtual device:->pool-devices' ;; + zpool:prefetch) + _arguments -A "-*" -S \ + '-t+[metadata type]:metadata type:(( + brt\:block\ reference\ table + ddt\:deduplication\ table + ))' \ + ':pool:_zfs_pool' + ;; + zpool:reopen) _arguments -A "-*" -S \ "-n[don't restart an in-progress scrub operation]" \ @@ -1180,7 +1246,9 @@ case $service:$words[1] in ;; zpool:reguid) - _zfs_pool + _arguments -A "-*" -S \ + '-g+[set pool guid]:guid (64-bit decimal)' \ + ':pool:_zfs_pool' ;; zpool:remove) @@ -1215,6 +1283,10 @@ case $service:$words[1] in zpool:scrub) [[ $implementation = openzfs ]] && args=( + '(-a --all *)'{-a,--all}'[begin, pause, stop scrub on all pools]' + '-C[continue scrub from last saved txg]' + '-S+[specify start date for transactions]:date (YYYY-MM-DD HH\:MM):_dates' + '-E+[specify end date for transactions]:date (YYYY-MM-DD HH\:MM):_dates' '(-s)-p[pause scrubbing]' '-w[wait until scrub has completed before returning]' '-e[only scrub files with known data errors]' @@ -1259,6 +1331,9 @@ case $service:$words[1] in '-c+[run scripts on each vdev]:script:_sequence _files -W "($ZPOOL_SCRIPTS_PATH /etc/zfs/zpool.d ~/.zpool.d)"' '-e[only show unhealthy vdevs]' '-i[display vdev initialization status]' + '(-j --json)'{-j,--json}'[output in JSON format]' + '--json-int[output numbers in integer format instead of strings]' + --json-flat-vdevs --json-pool-key-guid '-g[display vdev GUIDs instead of the normal device names]' '-L[display real paths for vdevs resolving all symbolic links]' '-p[display numbers in parsable (exact) values and times in nanoseconds]' @@ -1280,6 +1355,7 @@ case $service:$words[1] in zpool:trim) _arguments -C -A "-*" -S \ + '(-a --all 1 *)'{-a,--all}'[perform TRIM on all pools]' \ '(-d --secure)'{-d,--secure}'[initiate a secure TRIM]' \ '(-r --rate)'{-r,--rate}'[set rate at which the TRIM operation progresses]:rate (bytes per second)' \ '(-c --cancel)'{-c,--cancel}'[cancel trimming]' \ diff --git a/Completion/Unix/Type/_date_formats b/Completion/Unix/Type/_date_formats index 55af7c591..0527d706c 100644 --- a/Completion/Unix/Type/_date_formats +++ b/Completion/Unix/Type/_date_formats @@ -59,7 +59,7 @@ specs=( ) case $OSTYPE in - linux-gnu) + freebsd*|linux-gnu) [[ $1 == zsh ]] || # %N is handled below in this case specs+=( 'N:fractional part of seconds since epoch, in nanoseconds' ) ;| diff --git a/Completion/Unix/Type/_pspdf b/Completion/Unix/Type/_pspdf index 1df3f860c..3fcc2175f 100644 --- a/Completion/Unix/Type/_pspdf +++ b/Completion/Unix/Type/_pspdf @@ -1,4 +1,4 @@ -#compdef gsbj gsdj gsdj500 gslj gslp gsnd ps2ascii ghostview mgv pstoedit pstotgif +#compdef gsbj gsdj gsdj500 gslj gslp ps2ascii ghostview mgv pstoedit pstotgif local expl ext diff --git a/Completion/Unix/Type/_terminals b/Completion/Unix/Type/_terminals index 04ece1167..156ba7e96 100644 --- a/Completion/Unix/Type/_terminals +++ b/Completion/Unix/Type/_terminals @@ -1,8 +1,37 @@ #compdef infocmp -value-,TERM,-default- -local desc expl +local entry +local -aU desc +local -a terms names -desc=( $TERMINFO ~/.terminfo $TERMINFO_DIRS /usr/{,share/}{,lib/}terminfo /{etc,lib}/terminfo ) +desc=( + $TERMINFO ~/.terminfo $TERMINFO_DIRS /usr/{,share/}{,lib/}terminfo + /{etc,lib}/terminfo +) +desc=( $desc(N:P) ) # may have symlinks to the same path +terms=( $desc/*/^*+?*(N:t) ) # entries named with a + are common includes -_wanted terminals expl 'terminal name' \ - compadd "$@" - $desc/*/*(N:t) +if [[ $OSTYPE = (freebsd|dragonfly)* ]]; then + while read entry; do + [[ "$entry" != [^[:blank:]\#\*_]*:* ]] && continue + + names=( ${${(s:|:)entry%%:*}##[[:blank:]]#} ) + if [[ $#names -gt 1 && $names[-1] = *\ * ]]; then + terms+=( ${^names[1,-2]:#*[ +]?*}:${names[-1]} ) + else + terms+=( ${names:#*\ *} ) + fi + done < /etc/termcap + +elif [[ $OSTYPE = netbsd* ]]; then + grep $'^[^#\t]*,$' /usr/share/misc/terminfo | while read entry; do + names=( ${(s:|:)entry%,} ) + if [[ $#names -gt 1 && $names[-1] = *\ * ]]; then + terms+=( ${^names[1,-2]:#*[ +]?*}:${names[-1]} ) + else + terms+=( ${names:#*\ *} ) + fi + done +fi + +_describe -t terminals 'terminal name' terms "$@" diff --git a/Completion/X/Command/_nedit b/Completion/X/Command/_nedit index 75ca1bad4..8bf7cac43 100644 --- a/Completion/X/Command/_nedit +++ b/Completion/X/Command/_nedit @@ -1,4 +1,4 @@ -#compdef nedit nedit-nc=nc ncl=nc +#compdef nedit nedit-nc=nc ncl=nc nedit-client=nc local state line expl nedit_common curcontext="$curcontext" ret=1 typeset -A opt_args diff --git a/Completion/X/Command/_papers b/Completion/X/Command/_papers new file mode 100644 index 000000000..1c6076728 --- /dev/null +++ b/Completion/X/Command/_papers @@ -0,0 +1,18 @@ +#compdef papers + +_arguments -s -S : \ + + '(help)' \ + '(- : *)--version[display version information]' \ + '(- : *)'{-h,--help}'[display help information]' \ + '(- : *)--help-all[display all help information]' \ + '(- : *)--help-gapplication[display help information for GApplication options]' \ + + '(mode)' \ + {-f,--fullscreen}'[run in fullscreen mode]' \ + {-s,--presentation}'[run in presentation mode]' \ + + '(page)' \ + {-p,--page-label=}'[specify page label of document to display]:page label:' \ + {-i,--page-index=}'[specify page number of document to display]:page index:' \ + {-n,--named-dest=}'[specify named destination to display]:named destination:' \ + + etc \ + '--gapplication-service[enter GApplication service mode]' \ + '*:document file:_files -g "*.(#i)(cb7|cbr|cbt|cbz|djv|djvu|pdf|tif|tiff)(-.)"' diff --git a/Completion/X/Command/_pdftk b/Completion/X/Command/_pdftk index b26deb15f..4029e52fe 100644 --- a/Completion/X/Command/_pdftk +++ b/Completion/X/Command/_pdftk @@ -6,8 +6,7 @@ _pdfwithhandle() _files "$@" -g '(#i)*.pdf' } -local expl -local -a opts operations +local -a expl opts operations opts=(output encrypt_40bit encrypt_128bit allow owner_pw user_pw flatten compress uncompress keep_first_id keep_final_id drop_xfa verbose @@ -22,15 +21,13 @@ case $words[CURRENT-1] in ;; (allow) - #_description permissions expl "permission" - #compadd $expl \ _values -s , permission \ Printing DegradedPrinting ModifyContents Assembly CopyContents \ ScreenReaders ModifyAnnotations FillIn AllFeatures ;; (attach_files) - _files "$@" + _files ;; (fill_form) @@ -51,11 +48,9 @@ case $words[CURRENT-1] in esac && return 0 if [[ -n $words[(r)(${(j:|:)operations})] ]]; then - _description options expl "option" - compadd $@ $expl $opts + _wanted options expl "option" compadd -a opts else - _tags files operations - _alternative \ - 'files:PDF file:_pdfwithhandle' \ - "operations:operation:($operations)" + _alternative \ + 'files:PDF file:_pdfwithhandle' \ + "operations:operation:compadd -a operations" fi diff --git a/Completion/X/Command/_sioyek b/Completion/X/Command/_sioyek new file mode 100644 index 000000000..d9b15a953 --- /dev/null +++ b/Completion/X/Command/_sioyek @@ -0,0 +1,29 @@ +#compdef sioyek + +_arguments -S \ + '--new-instance[create a new instance of sioyek when opening a file]' \ + '--instance-name[select a specific sioyek instance by name]:name: ' \ + '--new-window[open file in a new window within same instance]' \ + '--reuse-window[force reuse of current window]' \ + '--nofocus[do not bring instance to foreground]' \ + '--version[print sioyek version]' \ + '--page[which page to open]:page number: ' \ + '--focus-text[set a visual mark on line including text]:text: ' \ + '--focus-text-page[page to use for focus-text]:page number: ' \ + '--inverse-search[command to execute for inverse search]:command: ' \ + '--execute-command[command to execute on running instance]:command: ' \ + '--execute-command-data[optional data for execute-command]:data: ' \ + '--forward-search-file[forward search on file]:file:_files' \ + '--forward-search-line[forward search on line]:line: ' \ + '--forward-search-column[forward search on column]:column: ' \ + '--zoom[set zoom level]:zoom level: ' \ + '--xloc[set x position within page]:x-coordinate: ' \ + '--yloc[set y position within page]:y-coordinate: ' \ + '--window-id[apply command to specific window id]:window id: ' \ + '--shared-database-path[path for shared bookmarks/highlights]:database path:_files' \ + '--verbose[print extra information]' \ + '--wait-for-response[wait for command to finish before returning]' \ + '--no-auto-config[disable all config files except those next to executable]' \ + '(-h --help)'{-h,--help}'[display help information]' \ + '--help-all[display help including generic Qt options]' \ + '*:pdf file:_files -g "*.pdf(-.)"' diff --git a/Completion/Zsh/Command/_compinit b/Completion/Zsh/Command/_compinit new file mode 100644 index 000000000..eed4dacb8 --- /dev/null +++ b/Completion/Zsh/Command/_compinit @@ -0,0 +1,9 @@ +#compdef compinit + +_arguments : \ + '(-i -u)-C[bypass security and dump-file checks]' \ + '-d+[automatically create dump file / specify dump-file path]::dump file:_files' \ + "-D[don't automatically create dump file]" \ + '(-C -u)-i[ignore insecure files]' \ + "(-C -i)-u[don't check for insecure files]" \ + "-w[explain why dump file isn't loaded]" diff --git a/Completion/Zsh/Command/_emulate b/Completion/Zsh/Command/_emulate index d6fb0c3d9..a16738cdb 100644 --- a/Completion/Zsh/Command/_emulate +++ b/Completion/Zsh/Command/_emulate @@ -1,8 +1,9 @@ #compdef emulate -_arguments -C -s \ - '-L[set local_options and local_traps as well]' \ +_arguments -s -S -A '-*' : \ + '(2 3)-l[list options to be set or unset]' \ + '(2 3)-L[set local_options and local_traps as well]' \ '-R[reset all options instead of only those needed for script portability]' \ '1:shell to emulate:(zsh sh ksh csh)' \ - '2:specify optional command:(-c)' \ - '3:command:_cmdstring' + '(-l -L)2:specify optional command:(-c)' \ + '(-l -L)3: :_cmdstring' diff --git a/Completion/Zsh/Command/_set b/Completion/Zsh/Command/_set index 27c7f3c7d..720c667a9 100644 --- a/Completion/Zsh/Command/_set +++ b/Completion/Zsh/Command/_set @@ -21,5 +21,5 @@ noglob _arguments -s -S \ {-,+}d[no-globalrcs] {-,+}e[errexit] {-,+}f[no-rcs] {-,+}g[histignorespace] \ {-,+}h[histignoredups] {-,+}i[interactive] {-,+}k[interactivecomments] \ {-,+}l[login] {-,+}m[monitor] {-,+}n[no-exec] {-,+}p[privileged] \ - {-,+}r[restricted] {-,+}t[singlecommand] {-,+}u[no-unset] {-,+}v[verbose] \ + {-,+}t[singlecommand] {-,+}u[no-unset] {-,+}v[verbose] \ {-,+}w[chaselinks] {-,+}x[xtrace] {-,+}y[shwordsplit] diff --git a/Completion/Zsh/Command/_zparseopts b/Completion/Zsh/Command/_zparseopts index ae81937c1..cc5e28a9a 100644 --- a/Completion/Zsh/Command/_zparseopts +++ b/Completion/Zsh/Command/_zparseopts @@ -13,6 +13,7 @@ _arguments -A '-*' : \ '-G[enable GNU-style parsing]' \ '-K[preserve contents of arrays/associations when specs are not matched]' \ '-M[enable mapping among equivalent options with opt1=opt2 spec form]' \ + '-n+[specify program name for usage errors]:program name' \ '-v+[specify array from which to parse options]:array:_parameters -g "*array*"' \ '(-)-[end zparseopts options; specs follow]' \ '*: :->spec' \ diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index 0c81c2f2e..9bba030c8 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -339,7 +339,7 @@ while (( $#state )); do ctop=c ;; - (:chwpd:*) + (:chpwd:*) ctop=d ;; diff --git a/Completion/Zsh/Type/_jobs_fg b/Completion/Zsh/Type/_jobs_fg index 57117f0d6..49bf72425 100644 --- a/Completion/Zsh/Type/_jobs_fg +++ b/Completion/Zsh/Type/_jobs_fg @@ -1,3 +1,8 @@ #compdef disown fg -_jobs "$@" +local -a ca_args=( "$@" ) +local -a args=( '(-)*: :_jobs' ) + +[[ $service == disown ]] && args+=( '(: *)-a[disown all jobs]' ) + +_arguments -s -S -A '-*' -O ca_args : $args diff --git a/Completion/compinit b/Completion/compinit index 60dbb599d..900900644 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -345,7 +345,7 @@ compdef() { [[ $2 = .menu-select ]] && zmodload -i zsh/complist zle -C "$1" "$2" "$func" if [[ -n $new ]]; then - bindkey "$3" | IFS=$' \t' read -A opt + opt=( ${(z)${ bindkey "$3" }} ) [[ $opt[-1] = undefined-key ]] && bindkey "$3" "$1" else bindkey "$3" "$1" @@ -372,8 +372,8 @@ compdef() { # And bind the keys... for i; do if [[ -n $new ]]; then - bindkey "$i" | IFS=$' \t' read -A opt - [[ $opt[-1] = undefined-key ]] || continue + opt=( ${(z)${ bindkey "$i" }} ) + [[ $opt[-1] = undefined-key ]] || continue fi bindkey "$i" "$func" done @@ -461,6 +461,7 @@ if [[ -n "$_i_check" ]]; then if ! read -q \ "?zsh compinit: insecure $_i_q, run compaudit for list. Ignore insecure $_i_q and continue [y] or abort compinit [n]? "; then + print -u2 print -u2 "$0: initialization aborted" unfunction compinit compdef unset _comp_dumpfile _comp_secure compprefuncs comppostfuncs \ @@ -468,6 +469,7 @@ Ignore insecure $_i_q and continue [y] or abort compinit [n]? "; then return 1 fi + print -u2 fi fpath=(${fpath:|_i_wdirs}) (( $#_i_wfiles )) && _i_files=( "${(@)_i_files:#(${(j:|:)_i_wfiles%.zwc})}" ) @@ -484,6 +486,8 @@ autoload -RUz compdump compinstall _i_done='' +[[ _i_why -eq 1 ]] && print -ru2 "Using dump file: $_comp_dumpfile" + if [[ -f "$_comp_dumpfile" ]]; then if [[ -n "$_i_check" ]]; then IFS=$' \t' read -rA _i_line < "$_comp_dumpfile" @@ -493,7 +497,7 @@ if [[ -f "$_comp_dumpfile" ]]; then builtin . "$_comp_dumpfile" _i_done=yes elif [[ _i_why -eq 1 ]]; then - print -nu2 "Loading dump file skipped, regenerating" + print -nu2 "Loading dump file skipped" local pre=" because: " if [[ _i_autodump -ne 1 ]]; then print -nu2 $pre"-D flag given" @@ -513,8 +517,9 @@ if [[ -f "$_comp_dumpfile" ]]; then _i_done=yes fi elif [[ _i_why -eq 1 ]]; then - print -u2 "No existing compdump file found, regenerating" + print -u2 "No existing dump file found" fi + if [[ -z "$_i_done" ]]; then typeset -A _i_test @@ -547,6 +552,7 @@ if [[ -z "$_i_done" ]]; then # If autodumping was requested, do it now. if [[ $_i_autodump = 1 ]]; then + [[ _i_why -eq 1 ]] && print -u2 "Regenerating dump file" compdump fi fi |
