From 8645836f09bd7d1060f124a18bab534ee4970dc0 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Wed, 6 Nov 2019 06:52:26 +0000 Subject: Add zsh completion support This adds completion support for all the current commands, including completion for sink and source names where they are used. --- examples/zsh-completion/_dtas-mlib | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/zsh-completion/_dtas-mlib (limited to 'examples/zsh-completion/_dtas-mlib') diff --git a/examples/zsh-completion/_dtas-mlib b/examples/zsh-completion/_dtas-mlib new file mode 100644 index 0000000..24418ea --- /dev/null +++ b/examples/zsh-completion/_dtas-mlib @@ -0,0 +1,29 @@ +#compdef dtas-mlib + +# To the extent possible under law, James Rowe has waived all copyright and +# related or neighboring rights to this example. +# +_arguments \ + "--database=[database]:select file:_files" \ + "--force[force updates]" \ + "--help[display help message]" \ + ':dtas-mlib action:(( + dump\:"dump database" + search\:"search database" + stats\:"display statistics" + update\:"migrate database" + ))' \ + "*::subcmd:->subcmd" && return 0 + +case "$words[1]" in +(dump|update) + _arguments -S \ + ":select directory:_path_files -/" + ;; +(search) + _arguments -S \ + "*:search term:" + ;; +(*) + ;; +esac -- cgit v1.2.3-24-ge0c7