Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: completion updates for NetBSD 11 and OpenBSD 8
- X-seq: zsh-workers 55232
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: completion updates for NetBSD 11 and OpenBSD 8
- Date: Fri, 30 Oct 2026 02:05:13 +0100
- Archived-at: <https://zsh.org/workers/55232>
- List-id: <zsh-workers.zsh.org>
This updates the completions for base system utilities in these new
BSD releases. Notably, this includes openssh 10.6.
Oliver
diff --git a/Completion/BSD/Type/_bsd_disks b/Completion/BSD/Type/_bsd_disks
index 986d36e45..eabd5ed1f 100644
--- a/Completion/BSD/Type/_bsd_disks
+++ b/Completion/BSD/Type/_bsd_disks
@@ -13,7 +13,7 @@ case $OSTYPE in
disks=( ${${(s.,.)"$(sysctl -n hw.disknames)"}%\:*} )
;;
netbsd*)
- disks=( $(sysctl -n hw.disknames) )
+ disks=( $(/sbin/sysctl -n hw.disknames) )
;;
esac
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index f0bde2dcb..a8afaa09f 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -65,6 +65,11 @@ case "$variant" in
"(1)-I[remove all inherited entries from specified files' ACLs]"
)
;;
+ netbsd*)
+ args+=(
+ "-d[don't attempt changes if desired values already apply]"
+ )
+ ;;
esac
_arguments -C -s -S -0 $aopts "$args[@]" && ret=0
diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown
index 36db9c4d2..82800e35f 100644
--- a/Completion/Unix/Command/_chown
+++ b/Completion/Unix/Command/_chown
@@ -67,6 +67,11 @@ case "$variant" in
'-n[interpret user and group as numeric, avoiding name lookups]'
)
;;
+ netbsd*)
+ args+=(
+ "-d[don't attempt changes if desired values already apply]"
+ )
+ ;;
esac
(( $+words[(r)--reference*] )) || args+=( '(--reference)1: :->owner' )
diff --git a/Completion/Unix/Command/_date b/Completion/Unix/Command/_date
index 8ff685884..03bb18a4d 100644
--- a/Completion/Unix/Command/_date
+++ b/Completion/Unix/Command/_date
@@ -76,7 +76,7 @@ else
;|
openbsd*|netbsd*) args+=( '-a[gradually skew]' )
;|
- darwin*|freebsd<14->.*|openbsd*)
+ darwin*|freebsd<14->.*|(net|open)bsd*)
args+=( '-z+[specify timezone for output]:time zone:_time_zone')
;|
freebsd*)
@@ -85,7 +85,7 @@ else
)
;|
netbsd*)
- args+=( '-d[output date specified by string]:time string:' )
+ args+=( '-d[output date specified by string]:time string' '!(-u -z)-U' )
;;
esac
fi
diff --git a/Completion/Unix/Command/_df b/Completion/Unix/Command/_df
index ebfe96186..9fccc5f29 100644
--- a/Completion/Unix/Command/_df
+++ b/Completion/Unix/Command/_df
@@ -87,7 +87,9 @@ elif [[ "$OSTYPE" == (darwin|dragonfly|freebsd|netbsd*|openbsd)* ]]; then
args+=(
'(-P -G -N)-f[display only the available free]'
'(-G -i -P)-G[display all fields in statvfs]'
+ '-M[warn for arguments that are not a mount point]'
'(-G -P)-N[suppress the header line normally output]'
+ '-q[suppress all warning output]'
'-W[print wedge name instead of the device]'
)
;;
diff --git a/Completion/Unix/Command/_install b/Completion/Unix/Command/_install
index 5f0507329..b65ae6226 100644
--- a/Completion/Unix/Command/_install
+++ b/Completion/Unix/Command/_install
@@ -56,11 +56,9 @@ else
'-r[use temporary files to perform safe copy]'
'-S+[specify arguments to pass to strip program]:arguments to strip program'
)
- [[ $OSTYPE == (net|open)bsd* ]] && {
- # (Net|Open)BSD has no -v for some reason
+ [[ $OSTYPE == openbsd* ]] && args=(
+ # OpenBSD has no -v
args=( ${args##((#s)|*\))(\*|)-v*} )
- }
- [[ $OSTYPE == openbsd* ]] && args+=(
'-D[create all leading destination path components]'
'-F[flush installed file contents to disk]'
'!-S[no effect (supported for compatibility)]'
diff --git a/Completion/Unix/Command/_iostat b/Completion/Unix/Command/_iostat
index 36a3b7904..8705d766e 100644
--- a/Completion/Unix/Command/_iostat
+++ b/Completion/Unix/Command/_iostat
@@ -49,6 +49,7 @@ case $OSTYPE:l in
netbsd*)
args+=(
'-x[show extended disk statistics]'
+ '-X[show limited alternative disk statistics]'
'-y[report data on waiting and active requests]'
'-z[replace drive and CPU statistics that are zero with spaces]'
"-H+[set page height explicitly]:height [$LINES]"
diff --git a/Completion/Unix/Command/_netstat b/Completion/Unix/Command/_netstat
index 256337e22..4c6bc1030 100644
--- a/Completion/Unix/Command/_netstat
+++ b/Completion/Unix/Command/_netstat
@@ -114,7 +114,6 @@ case $OSTYPE in
sel_pcb=( '-P+[display contents of the protocol control block]:pcb' )
routing+=( $verbose '(-L)-s[show routing statistics]' )
groups+=( $families
- '(-s)-l[display wider fields for the IPv6 multicast routing table]'
'(-l)-s[show multicast routing statistics]'
)
interfaces+=(
@@ -271,18 +270,18 @@ case $OSTYPE in
sel_wireless=( '-W+[display per-interface IEEE 802.11 wireless statistics]:interface' )
flist+=( local mpls )
tblopt='-T+[select an alternate routing table to query]:routing table:_routing_tables'
- sockets+=( -l$lopt $tblopt '-B[show buffer sizes for TCP sockets]' )
- routing+=( $Mopts $tblopt
+ sockets+=( -l$lopt $tblopt $verbose '-B[show buffer sizes for TCP sockets]' )
+ routing+=( $Mopts $tblopt $verbose
'-A[show the internal addresses of the routing table]'
'-F[only show routes with gateway in the same address family as the destination]'
)
- interfaces+=(
+ interfaces+=( $verbose
'-c+[show specified number of updates, then exit]:count'
'-e[show only the number of errors on the interface]'
'-q[only show interfaces that have seen packets]'
)
statistics+=( $popt '-r[display routing statistics]' )
- groups+=( -n$nopt )
+ groups+=( -n$nopt $verbose $sel_interfaces )
pcb+=( $Mopts $verbose )
;;
netbsd*)
@@ -291,6 +290,9 @@ case $OSTYPE in
flist+=( arp ns atalk mpls local )
sets+=( queues '-[^-]#q*' )
sel_queues=( '-q[display software interrupt queue details for all protocols]' )
+ groups+=(
+ '(-s)-l[display wider fields for the IPv6 multicast routing table]'
+ )
routing+=( $Xopt
"(-s)-L[don't show link-level routes]"
'-T[show MPLS tags for the routing tables]'
diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep
index b3ef86223..33f96a28b 100644
--- a/Completion/Unix/Command/_pgrep
+++ b/Completion/Unix/Command/_pgrep
@@ -96,8 +96,8 @@ case $OSTYPE in
pkopts=fGgIlnoPqsTtUuvx
;;
netbsd*)
- pgopts=dfGgilnPqstUuvx
- pkopts=fGgilnPstUuvx
+ pgopts=dfFGgilLnPqstUuvx
+ pkopts=fFGgilLnPstUuvx
;;
darwin*)
pgopts=adFfGgiLlnoPqtUuvx
diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh
index c95849e84..7dcd9919c 100644
--- a/Completion/Unix/Command/_ssh
+++ b/Completion/Unix/Command/_ssh
@@ -43,9 +43,9 @@ _ssh () {
'-D+[specify a dynamic port forwarding]:dynamic port forwarding:->dynforward' \
'-e+[set escape character]:escape character:_phony none' \
'-E+[append log output to file instead of stderr]:log file:_files' \
- '(-n)-f[go to background]' \
+ '(-n -Z)-f[go to background]' \
'-g[allow remote hosts to connect to local forwarded ports]' \
- '-G[output configuration and exit]' \
+ '(-V -Z)-G[output configuration and exit]' \
'-I+[specify smartcard device]:device:_files' \
'-J+[connect via a jump host]: :->userhost' \
'-K[enable GSSAPI-based authentication and forwarding]' \
@@ -66,7 +66,7 @@ _ssh () {
'-s[invoke subsystem]' \
'(-t)-T[disable pseudo-tty allocation]' \
"(-T)*-t[force pseudo-tty allocation${tdesc}]" \
- '-V[show version number]' \
+ '(- *)-V[show version number]' \
'(-q)*-v[verbose mode (multiple increase verbosity, up to 3)]' \
'-W+[forward standard input and output to host]:stdinout forward:->hostport' \
'-w+[request tunnel device forwarding]:local_tun[\:remote_tun] (integer or "any"):' \
@@ -74,6 +74,7 @@ _ssh () {
'(-X -Y)-x[disable X11 forwarding]' \
'(-x -X)-Y[enable trusted X11 forwarding]' \
'-y[send log info via syslog instead of stderr]' \
+ '(-f -G -V *)-Z[list keys that would be attempted in order and exit]' \
':remote host name:->userhost' \
'*::args:->command' "$common[@]" && ret=0
;;
@@ -115,6 +116,7 @@ _ssh () {
'-l[list all identities]' \
'-m+[specify minimum remaining signatures before maximum is changed]:number' \
'-M+[specify maximum number of signatures]:number' \
+ '-P[skip PIN entry for FIDO and PKCS#11 tokens]' \
'-S+[use specified library when adding FIDO authenticator-hosted keys]:library:_files' \
'-s+[add keys provided by the PKCS#11 shared library]:library:_files -g "*.(so|dylib)(|.<->)(-.)"' \
'-t+[set maximum lifetime for identity]: :_numbers -u seconds "maximum lifetime" \:s\:seconds m\:minutes h\:hours d\:days w\:weeks' \
@@ -127,7 +129,8 @@ _ssh () {
;;
ssh-agent)
_arguments -s \
- '(-k)-a+[specify UNIX-domain socket to bind agent to]:UNIX-domain socket:_files' \
+ '(-k -a)-A+[specify directory of socket to bind agent to]:path:{ if compset -P 1 "*\:"; then _directories -W / -P /; else compadd -S"\:" user shared; fi }' \
+ '(-k -A)-a+[specify UNIX-domain socket to bind agent to]:UNIX-domain socket:_files' \
'(-k -s)-c[force csh-style shell]' \
'(-k)-d[debug mode]' \
'(-k)-D[foreground mode]' \
@@ -214,11 +217,11 @@ _ssh () {
tsizes=(
dsa 1024
ecdsa '256 384 521' # values appear in key names as listed with ssh -Q key - 521 really is correct
- rsa '1024 2048 4096'
+ rsa '1024 2048 3072 4096'
)
_arguments -s $args \
- "${p1}(${${(@)cmds:#-[pcKAO]}} ${${(@)cms:#-[t]}} -O)-a+[specify number of rounds]:rounds [16]" \
- "(${${(@)cmds:#-M}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key [2048]:"'compadd ${expl\:/-X/-x} ${_comp_mesg\:=-} ${=tsizes[${opt_args[create--t]\:-rsa}]}' \
+ "${p1}(${${(@)cmds:#-[pcKAO]}} ${${(@)cms:#-[t]}} -O)-a+[specify number of rounds]:rounds [32]" \
+ "(${${(@)cmds:#-M}} -P ${${(@)cms:#-[MS]}})-b+[specify number of bits in key]:bits in key [3072]:"'compadd ${expl\:/-X/-x} ${_comp_mesg\:=-} ${=tsizes[${opt_args[create--t]\:-rsa}]}' \
"$p1(${${(@)cmds:#-[pc]}} -b $cms)-P+[provide old passphrase]:old passphrase" \
"(${${(@)cmds:#-p}} -v ${${(@)cms:#-[qt]}})-N+[provide new passphrase]:new passphrase" \
"(${${(@)cmds:#-c}} -v $cms)-C+[provide new comment]:new comment" \
@@ -252,7 +255,7 @@ _ssh () {
"$p1($cmn)$algopt" \
- create \
'(-P -l)-q[silence ssh-keygen]' \
- "(-P -l)-t+[specify the type of the key to create]:key type:(rsa dsa ecdsa ed25519 ecdsa-sk ed25519-sk)" \
+ "(-P -l)-t+[specify the type of the key to create]:key type [ed25519]:(rsa dsa ecdsa ed25519 ecdsa-sk ed25519-sk mldsa44-ed25519)" \
- dns \
"($cmn)-r[print DNS resource record]:hostname:_hosts" \
"$p1($cmn)-g[use generic DNS format]" \
@@ -265,6 +268,7 @@ _ssh () {
"$p1($cmn -f -k -u)-n+[specify user/host principal names to include in certificate]:principals" \
"$p1($cmn -f -u)-V+[specify certificate validity interval]:interval:_phony -S\: always" \
"($cmn -I -h -n -D -O -U -V)-k[generate a KRL file]" \
+ "-t+[specify signature type]:signature type [rsa-sha2-512]:(ssh-rsa rsa-sha2-256 rsa-sha2-512)" \
"$p1($cmn -I -h -n -D -O -U -V)-u[update a KRL]" \
- signature \
"(${${(@)cmn:#-O}})-Y+[signature action]:action:((
@@ -343,7 +347,7 @@ _ssh () {
;;
esac
case "${IPREFIX#-o}" in
- (#i)(batchmode|canonicalizefallbacklocal|checkhostip|clearallforwardings|compression|enableescapecommandline|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forkafterauthentication|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapikeyexchange|gssapirenewalforcesrekey|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|tcpkeepalive|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|permitremoteopen|proxyusefdpass|stdinnull|streamlocalbindunlink|visualhostkey)=*)
+ (#i)(batchmode|canonicalizefallbacklocal|checkhostip|clearallforwardings|compression|enableescapecommandline|enablesshkeysign|exitonforwardfailure|fallbacktorsh|forkafterauthentication|forward(agent|x11)|forwardx11trusted|gatewayports|gssapiauthentication|gssapidelegatecredentials|gssapikeyexchange|gssapirenewalforcesrekey|gssapitrustdns|hashknownhosts|hostbasedauthentication|identitiesonly|kbdinteractiveauthentication|nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|permitremoteopen|proxyusefdpass|stdinnull|streamlocalbindunlink|visualhostkey)=*)
_wanted values expl 'truth value' compadd yes no && ret=0
;;
(#i)addkeystoagent=*)
@@ -373,8 +377,8 @@ _ssh () {
_message -e 'CNAME rule list (source_domain_list:target_domain_list, each pattern list comma separated)' && ret=0
;;
(#i)channeltimeout=*)
- _values 'channel type' \
- {agent-connection,direct-tcpip,forwarded-tcpip,session,tun-connection,x11-connection}:interval:'_numbers -u seconds timeout :s:seconds m:minutes h:hours d:days w:weeks' && ret=0
+ _values -s " " 'channel type' \
+ {global,agent-connection,direct-tcpip,forwarded-tcpip,session,tun-connection,x11-connection}:interval:'_numbers -f -u seconds timeout :s:seconds m:minutes h:hours d:days w:weeks' && ret=0
;;
(#i)ciphers=*)
state=ciphers
@@ -437,9 +441,9 @@ _ssh () {
if compset -P '* '; then
descr='QoS for non-interactive sessions'
else
- descr='QoS [for interactive sessions if second value given, separated by white space]'
+ descr='QoS (separated by white space)'
fi
- _values $descr 'af11' 'af12' 'af13' 'af14' 'af22' \
+ _values -s " " $descr 'af11' 'af12' 'af13' 'af14' 'af22' \
'af23' 'af31' 'af32' 'af33' 'af41' 'af42' 'af43' \
'cs0' 'cs1' 'cs2' 'cs3' 'cs4' 'cs5' 'cs6' 'cs7' 'ef' \
'lowdelay' 'throughput' 'reliability' && ret=0
@@ -554,6 +558,9 @@ _ssh () {
(#i)syslogfacility=*)
_wanted facilities expl 'facility' compadd -M 'm:{a-z}={A-Z}' DAEMON USER AUTH LOCAL{0,1,2,3,4,5,6,7} && ret=0
;;
+ (#i)(tcpkeepalive=*))
+ _wanted values expl 'truthish value [yes]' compadd yes no transport all && ret=0
+ ;;
(#i)(verifyhostkeydns|updatehostkeys)=*)
_wanted values expl 'truthish value' compadd yes no ask && ret=0
;;
diff --git a/Completion/Unix/Command/_touch b/Completion/Unix/Command/_touch
index b14900d66..0038af037 100644
--- a/Completion/Unix/Command/_touch
+++ b/Completion/Unix/Command/_touch
@@ -9,12 +9,16 @@ args=(
'(-r -d --date --reference 1)-t+[use specified time]:time ([[CC]YY]MMDDhhmm[.SS])'
)
case $variant in
+ gnu|netbsd*)
+ args+=(
+ '(-t -d --date -r --reference 1)'{-r+,--reference=}'[use corresponding times from specified reference file]:reference file:_files'
+ '(-t -d --date -r --reference 1)'{-d+,--date=}'[use specified date/time]:date/time'
+ )
+ ;|
gnu)
args+=(
'(-c --no-create)'{-c,--no-create}"[don't create file if it doesn't exist]"
'(-h --no-dereference)'{-h,--no-dereference}'[act on symbolic links themselves]'
- '(-t -d --date -r --reference)'{-r+,--reference=}'[use corresponding times from specified reference file]:file:_files'
- '(-t -d --date -r --reference)'{-d+,--date=}'[use specified date/time]:date/time'
'*--time=[change specified time]:time:(atime access use mtime modify)'
'(-)--help[display help information]'
'(-)--version[display version information]'
@@ -29,15 +33,21 @@ case $variant in
args+=( '-h[act on symbolic links themselves]' )
;|
darwin*|dragonfly*|freebsd*|openbsd*|solaris*)
- args+=( '(-r -t 1)-d+[use specified date/time]:date/time' )
+ args+=( '(-r -t 1)-d+[use specified ISO 8601 format date/time]:date/time (ccyy-mm-ddTHH:MM:SS[.frac][Z])' )
;|
darwin*|dragonfly*|freebsd*|netbsd*|solaris*)
args+=( '1:: :_guard "[0-9]#" "timespec (MMDDhhmm[YY])"' )
;|
+ netbsd*)
+ args+=(
+ "-D[don't attempt changes if desired values already apply]"
+ '!(-t -d --date -r --reference 1)-R+:reference file:_files'
+ )
+ ;|
*) # not GNU
args=( -A "-*" $args
"(-A)-c[don't create file if it doesn't exist]"
- '(-t -d 1)-r+[use corresponding times from specified reference file]:file:_files'
+ '(-t -d -R --reference --date 1)-r+[use corresponding times from specified reference file]:reference file:_files'
)
;;
esac
Messages sorted by:
Reverse Date,
Date,
Thread,
Author