diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-01-10 17:02:38 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-01-10 23:16:36 +0900 |
commit | f822279e6205722417f28a225bebf15261a7b547 (patch) | |
tree | b91a588afb4aedf724fa37f841d61399dafebd3f /shell-completion | |
parent | 29e08b9e9e4c7758f4c87110dc77b2c961205cfe (diff) | |
download | systemd-f822279e6205722417f28a225bebf15261a7b547.tar.gz |
bash-completion: localectl: add a missing option and verbs
Diffstat (limited to 'shell-completion')
-rw-r--r-- | shell-completion/bash/localectl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl index 97c91a4ce2..f02476f733 100644 --- a/shell-completion/bash/localectl +++ b/shell-completion/bash/localectl @@ -35,7 +35,7 @@ _localectl() { 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 @@ -53,10 +53,11 @@ _localectl() { 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 @@ -68,6 +69,8 @@ _localectl() { 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) |