local i verb comps locale_vals
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local OPTS='-h --help --version --no-convert --no-pager --no-ask-password
- -H --host --machine'
+ -H --host -M --machine'
if __contains_word "$prev" $OPTS; then
case $prev in
fi
local -A VERBS=(
- [STANDALONE]='status list-locales list-keymaps'
- [LOCALES]='set-locale'
- [KEYMAPS]='set-keymap'
- [X11]='set-x11-keymap'
+ [STANDALONE]='status list-locales list-keymaps list-x11-keymap-models list-x11-keymap-layouts list-x11-keymap-options'
+ [VARIANTS]='list-x11-keymap-variants'
+ [LOCALES]='set-locale'
+ [KEYMAPS]='set-keymap'
+ [X11]='set-x11-keymap'
)
for ((i=0; i < COMP_CWORD; i++)); do
if [[ -z $verb ]]; then
comps=${VERBS[*]}
+ elif __contains_word "$verb" ${VERBS[VARIANTS]}; then
+ comps=$(command localectl list-x11-keymap-layouts)
elif __contains_word "$verb" ${VERBS[LOCALES]}; then
if [[ $cur = *=* ]]; then
mapfile -t locale_vals < <(command localectl list-locales 2>/dev/null)