aboutsummaryrefslogtreecommitdiff
path: root/openrussian-completion.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'openrussian-completion.zsh')
-rw-r--r--openrussian-completion.zsh12
1 files changed, 12 insertions, 0 deletions
diff --git a/openrussian-completion.zsh b/openrussian-completion.zsh
new file mode 100644
index 0000000..e3669c0
--- /dev/null
+++ b/openrussian-completion.zsh
@@ -0,0 +1,12 @@
+#compdef openrussian
+
+# FIXME: If supported by `-C`, we could even show translations in the completions'
+# help strings.
+_get_terms() {
+ compadd "${(@f)"$(openrussian -C "$words[-1]" 2>/dev/null)"}"
+}
+
+_arguments '-Len[Generate English translations]' '-Lde[Generate German translations]' \
+ '-V[Verbatim matching (no case folding and inflections)]' \
+ '-p[Print Troff code to stdout]' \
+ '*:term:_get_terms'