zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _cabal (cabal-install)
@ 2015-04-10 23:25 Clint Adams
  0 siblings, 0 replies; only message in thread
From: Clint Adams @ 2015-04-10 23:25 UTC (permalink / raw)
  To: zsh-workers

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"'


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-10 23:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 23:25 PATCH: _cabal (cabal-install) Clint Adams

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).