diff options
Diffstat (limited to 'Completion/BSD/Command')
| -rw-r--r-- | Completion/BSD/Command/_ipfw | 2 | ||||
| -rw-r--r-- | Completion/BSD/Command/_jail | 20 | ||||
| -rw-r--r-- | Completion/BSD/Command/_jls | 15 | ||||
| -rw-r--r-- | Completion/BSD/Command/_kdump | 2 | ||||
| -rw-r--r-- | Completion/BSD/Command/_ktrace | 2 | ||||
| -rw-r--r-- | Completion/BSD/Command/_mdo | 48 | ||||
| -rw-r--r-- | Completion/BSD/Command/_pfctl | 1 | ||||
| -rw-r--r-- | Completion/BSD/Command/_sockstat | 6 |
8 files changed, 77 insertions, 19 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 |
