diff options
| author | Oliver Kiddle <opk@zsh.org> | 2024-08-31 11:58:33 +0200 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2024-08-31 11:58:33 +0200 |
| commit | 678fb68879e52a7e608dbbb859f98c2f9ff171eb (patch) | |
| tree | 2cbf074fe539c21bba4080e717b6f1044a13edc3 /Completion | |
| parent | unposted: remove reference to removed sample code (diff) | |
| download | zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar.gz zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar.bz2 zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar.lz zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar.xz zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.tar.zst zsh-678fb68879e52a7e608dbbb859f98c2f9ff171eb.zip | |
53052: update setxkbmap completion with newer options
Diffstat (limited to 'Completion')
| -rw-r--r-- | Completion/X/Command/_setxkbmap | 198 |
1 files changed, 108 insertions, 90 deletions
diff --git a/Completion/X/Command/_setxkbmap b/Completion/X/Command/_setxkbmap index 882a6f939..0850d5419 100644 --- a/Completion/X/Command/_setxkbmap +++ b/Completion/X/Command/_setxkbmap @@ -1,101 +1,119 @@ #compdef setxkbmap -# TODO: -# model, option, symbols and types suggestions -# take -layout and -variant into account +local curcontext="$curcontext" sourcedir layout ret=1 +local -a state state_descr line expl matches suf +local -A opt_args -_setxkbmap() { - emulate -L zsh - setopt extendedglob +_arguments -C \ + '(-)'{-\?,-help}'[display help message]' \ + '-compat[compatibility map]:compatibility:->compatmaps' \ + '-config[configuration file]:configuration:_files' \ + '-device[specify numeric id of the input device]:device:->devices' \ + '-display[display]:display:_x_display' \ + '-geometry[geometry component]:geometry:->geometries' \ + '*-I+[add a directory to be searched for layout or rules files]: :_directories' \ + '-keycodes[specify keycodes component name]:name' \ + '-keymap[specify keymap to load]:keymap' \ + '-layout[specify layout used to choose component names]:layout:->layouts' \ + '-model[specify model used to choose component names]:model:->models' \ + '*-option[add an xkb option]:option:->options' \ + '(-)'-print'[print a complete xkb_keymap description]' \ + '-query[print the current layout settings]' \ + '-rules[specify rules file to use]:rules:->rules' \ + '-symbols[specify symbols component name]:symbol' \ + '-synch[force synchronization]' \ + '-types[types components]:type:->types' \ + '(-verbose -v)'{-verbose,-v}'[set verbosity level]:verbosity:(0 1 2 3 4 5 6 7 8 9)' \ + '(-)-version[display version information]' \ + '-variant[specify layout variant used to choose component name]:variant:->variants' \ + '1:layout:->layouts' \ + '2:variant:->variants' \ + '*:option:->options' && ret=0 - # xkb files may be in different places depending on system - local dir sourcedir fullname - local -a searchdirs=(${XDG_DATA_HOME:-~/.local/share} ${(s.:.)XDG_DATA_DIRS:-/usr/lib:/usr/share:/usr/local/lib:/usr/local/share}) - for dir in $searchdirs; do - fullname="$dir/X11/xkb" |
