about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_cabal9
2 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2bf9db50f..646726337 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-10  Clint Adams  <clint@zsh.org>
+
+	* 34874: Completion/Unix/Command/_cabal: completion for cabal
+	command from cabal-install.
+
 2015-04-10  Daniel Hahler  <git@thequod.de>
 
 	* 34748: Completion/Unix/Command/_git: completion: git: update
diff --git a/Completion/Unix/Command/_cabal b/Completion/Unix/Command/_cabal
new file mode 100644
index 000000000..bd81cf261
--- /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"'