diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-03-23 16:54:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-03-25 05:52:56 +0000 |
commit | 1547e5b5d27c1e860782132e6c9d2985d74a1f4a (patch) | |
tree | b8c381b3a746e38c47e6875fe18defbc9cdfb4ce /completion | |
parent | 8ed234243cc3ed65f4b99fd94ac3b12b6fa27e0d (diff) | |
download | libinput-1547e5b5d27c1e860782132e6c9d2985d74a1f4a.tar.gz |
completion: add libinput analyze to zsh completions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'completion')
-rw-r--r-- | completion/zsh/_libinput | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/completion/zsh/_libinput b/completion/zsh/_libinput index 0bd9021f..c25fb7a5 100644 --- a/completion/zsh/_libinput +++ b/completion/zsh/_libinput @@ -9,6 +9,7 @@ "debug-gui:Show a GUI to visualize libinput's events" "debug-tablet:Show tablet axis and button values" "measure:Measure various properties of devices" + "analyze:Analyze device data" "record:Record the events from a device" "replay:Replay the events from a device" ) @@ -162,6 +163,33 @@ __all_seats() ':device:_files -W /dev/input/ -P /dev/input/' } +(( $+functions[_libinput_analyze] )) || _libinput_analyze() +{ + local curcontext=$curcontext state line ret=1 + local features + features=( + "per-slot-delta:analyze relative movement per touch per slot" + ) + + _arguments -C \ + '--help[Print help and exit]' \ + ':feature:->feature' \ + '*:: :->option-or-argument' + + case $state in + (feature) + _describe -t features 'feature' features + ;; + (option-or-argument) + curcontext=${curcontext%:*:*}:libinput-analyze-$words[1]: + if ! _call_function ret _libinput_analyze_$words[1]; then + _message "unknown feature: $words[1]" + fi + ;; + esac + return ret +} + (( $+functions[_libinput_record] )) || _libinput_record() { _arguments \ |