chiark / gitweb /
hashmap: add OrderedHashmap as a distinct type
[elogind.git] / shell-completion / zsh / _localectl
index c04f4f3..d8af4d1 100644 (file)
@@ -22,8 +22,8 @@ _localectl_set-locale() {
 
 _localectl_set-keymap() {
     local -a _keymaps
-    _keymaps=( ${(f)"$(_call_program locales "$service" list-keymaps)"} )
     if (( CURRENT <= 3 )); then
+        _keymaps=( ${(f)"$(_call_program locales "$service" list-keymaps)"} )
         _describe keymaps _keymaps
     else
         _message "no more options"
@@ -64,6 +64,10 @@ _localectl_command() {
         'set-keymap:Set virtual console keyboard mapping'
         'list-keymaps:Show known virtual console keyboard mappings'
         'set-x11-keymap:Set X11 keyboard mapping'
+        'list-x11-keymap-models:Show known X11 keyboard mapping models'
+        'list-x11-keymap-layouts:Show known X11 keyboard mapping layouts'
+        'list-x11-keymap-variants:Show known X11 keyboard mapping variants'
+        'list-x11-keymap-options:Show known X11 keyboard mapping options'
     )
     if (( CURRENT == 1 )); then
         _describe -t commands 'localectl command' _localectl_cmds
@@ -73,7 +77,7 @@ _localectl_command() {
         if (( $+functions[_localectl_$cmd] )); then
             _localectl_$cmd
         else
-            _message "no more options"
+            _message "unknown localectl command: $words[1]"
         fi
     fi
 }
@@ -85,4 +89,5 @@ _arguments \
     '--no-pager[Do not pipe output into a pager]' \
     '--no-ask-password[Do not prompt for password]' \
     {-H+,--host=}'[Operate on remote host]:userathost:_sd_hosts_or_user_at_host' \
+    {-M+,--machine=}'[Operate on local container]:machine' \
     '*::localectl commands:_localectl_command'