diff options
author | Robby Russell <robby@planetargon.com> | 2015-02-22 10:09:30 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2015-02-22 10:09:30 -0800 |
commit | 7c2d84f49de4d26318828e572f12090628d95e65 (patch) | |
tree | 24b448f8cbfc657898c8b9b041be0cd9137bf23d | |
parent | 2f23f33067066a8346579f3ec8e543fd1448a6af (diff) | |
parent | 3b6a695b60d81691ab8e31197fc8e0444df0e394 (diff) | |
download | zsh-7c2d84f49de4d26318828e572f12090628d95e65.tar.gz zsh-7c2d84f49de4d26318828e572f12090628d95e65.tar.bz2 zsh-7c2d84f49de4d26318828e572f12090628d95e65.zip |
Merge pull request #3569 from avalent/master
Add cab autocompletion to the cabal plugin
-rw-r--r-- | plugins/cabal/cabal.plugin.zsh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/cabal/cabal.plugin.zsh b/plugins/cabal/cabal.plugin.zsh index 9f76add7a..cf7d2cf5e 100644 --- a/plugins/cabal/cabal.plugin.zsh +++ b/plugins/cabal/cabal.plugin.zsh @@ -45,3 +45,43 @@ function _cabal_commands() { } compdef _cabal_commands cabal + +function _cab_commands() { + local ret=1 state + _arguments ':subcommand:->subcommand' && ret=0 + + case $state in + subcommand) + subcommands=( + "sync:Fetch the latest package index" + "install:Install packages" + "uninstall:Uninstall packages" + "installed:List installed packages" + "configure:Configure a cabal package" + "build:Build a cabal package" + "clean:Clean up a build directory" + "outdated:Display outdated packages" + "info:Display information of a package" + "sdist:Make tar.gz for source distribution" + "upload:Uploading tar.gz to HackageDB" + "get:Untar a package in the current directory" + "deps:Show dependencies of this package" + "revdeps:Show reverse dependencies of this package" + "check:Check consistency of packages" + "genpaths:Generate Paths_<pkg>.hs" + "search:Search available packages by package name" + "add:Add a source directory" + "test:Run tests" + "bench:Run benchmarks" + "doc:Generate manuals" + "ghci:Run GHCi (with a sandbox)" + "init:Initialize a sandbox" + "help:Display the help message of the command" + ) + _describe -t subcommands 'cab subcommands' subcommands && ret=0 + esac + + return ret +} + +command -v cab >/dev/null 2>&1 && { compdef _cab_commands cab } |