summaryrefslogtreecommitdiffstats
path: root/shell-completion/zsh
diff options
context:
space:
mode:
authorCyril Roelandt <cyril@redhat.com>2023-06-07 14:33:19 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-06-07 14:54:12 +0200
commit3c6fefd8791940c4ea3b15ed68458868edfbc243 (patch)
tree452fc2b881b417de2d4408457855e1b17f8cbca7 /shell-completion/zsh
parentkbd-model-map: change the order of Hungarian keymaps (diff)
downloadsystemd-3c6fefd8791940c4ea3b15ed68458868edfbc243.tar.xz
systemd-3c6fefd8791940c4ea3b15ed68458868edfbc243.zip
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
Diffstat (limited to 'shell-completion/zsh')
-rw-r--r--shell-completion/zsh/_localectl2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell-completion/zsh/_localectl b/shell-completion/zsh/_localectl
index 23422a9a4e..65babe2c08 100644
--- a/shell-completion/zsh/_localectl
+++ b/shell-completion/zsh/_localectl
@@ -12,8 +12,8 @@ _localectl_set-locale() {
local expl suf
_locales=( ${(f)"$(_call_program locales "$service" list-locales)"} )
- compset -P1 '*='
if [[ -prefix 1 *\= ]]; then
+ compset -P1 '*='
local conf=${PREFIX%%\=*}
_wanted locales expl "locales configs" \
_combination localeconfs confs=$conf locales "$@" -