Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _cabal (cabal-install)
- X-seq: zsh-workers 34874
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: _cabal (cabal-install)
- Date: Fri, 10 Apr 2015 23:25:05 +0000
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This is lousy and apparently I don't remember how to do things reasonably.
diff --git a/Completion/Unix/Command/_cabal b/Completion/Unix/Command/_cabal
new file mode 100644
index 0000000..bd81cf2
--- /dev/null
+++ b/Completion/Unix/Command/_cabal
@@ -0,0 +1,9 @@
+#compdef cabal
+
+local -a subcmds
+
+subcmds=(${${${${${(f)"$(cabal --help)"}[(r)Commands:*,(r)For more information*]}[2,-2]}# }%% *})
+
+_arguments \
+ '1:subcmd:compadd -a subcmds' \
+ ':other: _alternative "options:option:compadd -- $(cabal $words[2] --list-options)" "files:file:_files"'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author