]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh: fixup some recent zsh completers
authorRonan Pigott <ronan@rjp.ie>
Thu, 5 Mar 2026 22:42:30 +0000 (15:42 -0700)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 6 Mar 2026 00:17:02 +0000 (00:17 +0000)
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

shell-completion/zsh/_systemd-id128
shell-completion/zsh/_userdbctl

index 2cc06de80b026124c6ec23e42e800316e16dd6ad..33522e1e37d2265806a277dca4faa918f37bcc8b 100644 (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
 
index b3122fa908bfa0bfc1f604c2cb46e40a363ea342..2a2106b62ef3d8b0474b60289c5c9c3d0f6a2d5e 100644 (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