zsh: fixup some recent zsh completers

These two completers are written in a stacked _arguments style, and some
generic options are valid before or after the verb. If the toplevel
_arguments is permitted to match options after the verb, it will halt
completion prematurely, so stop toplevel matching after the verb.

This corrects the following error:

$ userdbctl --output=class user <TAB> # completes users
$ userdbctl user --output=class <TAB> # completes nothing
This commit is contained in:
Ronan Pigott
2026-03-06 00:17:02 +00:00
committed by Luca Boccassi
parent 802906bbbe
commit 0fc5c9ef2e
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ _systemd-id128_names() {
}
local ret=1
_arguments -s "$opt_common[@]" \
_arguments -s -A '-*' "$opt_common[@]" \
':command:->command' \
'*:: :->option-or-argument' && ret=0
+2 -2
View File
@@ -26,7 +26,7 @@ local -a opt_user_group=(
'-S[Equivalent to --disposition=system]'
'-R[Equivalent to --disposition=regular]'
'--uid-min=[Filter by minimum UID/GID]:uid:_numbers -t uids uid -d 0'
'--uid-max=[Filter by maximum UID/GID]:gid:_numbers -t gids gid -d 4294967294'
'--uid-max=[Filter by maximum UID/GID]:uid:_numbers -t uids uid -d 4294967294'
'--uuid=[Filter by UUID]:uuid'
'(-B)--boundaries=[Show/hide UID/GID range boundaries in output]:bool:(yes no)'
'(--boundaries)-B[Equivalent to --boundaries=no]'
@@ -44,7 +44,7 @@ local -a userdbctl_commands=(
)
local ret=1
_arguments -s \
_arguments -s -A '-*' \
"$opt_common[@]" \
':userdbctl command:->command' \
'*:: :->option-or-argument' && ret=0