summaryrefslogtreecommitdiff
path: root/shell-completion/zsh
diff options
context:
space:
mode:
Diffstat (limited to 'shell-completion/zsh')
-rw-r--r--shell-completion/zsh/_localectl13
1 files changed, 9 insertions, 4 deletions
diff --git a/shell-completion/zsh/_localectl b/shell-completion/zsh/_localectl
index 3d76bb0c4d..c04f4f3109 100644
--- a/shell-completion/zsh/_localectl
+++ b/shell-completion/zsh/_localectl
@@ -1,17 +1,22 @@
#compdef localectl
_localectl_set-locale() {
- local -a _confs _locales
+ local -a _locales locale_fields
+ locale_fields=(LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME \
+ LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER \
+ LC_NAME LC_ADDRESS LC_TELEPHONE \
+ LC_MEASUREMENT LC_IDENTIFICATION)
+ # LC_ALL is omitted on purpose
+
local expl suf
_locales=( ${(f)"$(_call_program locales "$service" list-locales)"} )
- _confs=( ${${(f)"$(_call_program confs "locale 2>/dev/null")"}%\=*} )
+ compset -P1 '*='
if [[ -prefix 1 *\= ]]; then
local conf=${PREFIX%%\=*}
- compset -P1 '*='
_wanted locales expl "locales configs" \
_combination localeconfs confs=$conf locales "$@" -
else
- compadd -S '=' $_confs
+ compadd -S '=' $locale_fields
fi
}