about summary refs log tree commit homepage
path: root/examples/zsh-completion/_dtas-mlib
diff options
context:
space:
mode:
Diffstat (limited to 'examples/zsh-completion/_dtas-mlib')
-rw-r--r--examples/zsh-completion/_dtas-mlib29
1 files changed, 29 insertions, 0 deletions
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