]> git.ipfire.org Git - thirdparty/systemd.git/commit
Fix zsh completion for "localectl set-locale"
authorCyril Roelandt <cyril@redhat.com>
Wed, 7 Jun 2023 12:33:19 +0000 (14:33 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 7 Jun 2023 12:54:12 +0000 (13:54 +0100)
commit3c6fefd8791940c4ea3b15ed68458868edfbc243
tree452fc2b881b417de2d4408457855e1b17f8cbca7
parent0fb19b9469a0a22fd3150b9f40eb948e2d7450c8
Fix zsh completion for "localectl set-locale"

When running:

    $ localectl set-locale LC_MESSAGES=<TAB>

One is prompted with a list of locale fields instead of the list of
valid locales. This is because by calling "compset -P1 '*='", we modify
the $PREFIX special parameter before testing whether it contains an
equal sign. Therefore

    if [[ -prefix 1 *\= ]]

is always false, and we always suggest a list of locale fields to the
user.

Fixes: #27955
shell-completion/zsh/_localectl