mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
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 (cherry picked from commit3c6fefd879
) (cherry picked from commita2ad241994
) (cherry picked from commit0baf6bc34d
)
This commit is contained in:
parent
aeeba4dfda
commit
c3ea065ce2
@ -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 "$@" -
|
||||
|
Loading…
Reference in New Issue
Block a user