summaryrefslogtreecommitdiff
path: root/plugins/gas/_gas
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2011-07-30 18:06:52 -0700
committerRobby Russell <robby@planetargon.com>2011-07-30 18:06:52 -0700
commit52a99d947ec0529d84d63afb202c7f03289e6bfe (patch)
tree9e33abbad35bfc92fd90a0fadbee11b6df0a1b70 /plugins/gas/_gas
parentdee8171fa9494d1aa6c01cb86de1b70b480ee5c4 (diff)
parentc3412ca57d313a0a1419d26b5529f28de49285d0 (diff)
downloadzsh-52a99d947ec0529d84d63afb202c7f03289e6bfe.tar.gz
zsh-52a99d947ec0529d84d63afb202c7f03289e6bfe.tar.bz2
zsh-52a99d947ec0529d84d63afb202c7f03289e6bfe.zip
Merge pull request #507 from walle/add_autocomplete_for_gas
Add autocomplete for gas
Diffstat (limited to 'plugins/gas/_gas')
-rw-r--r--plugins/gas/_gas34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/gas/_gas b/plugins/gas/_gas
new file mode 100644
index 000000000..befdc9459
--- /dev/null
+++ b/plugins/gas/_gas
@@ -0,0 +1,34 @@
+#compdef gas
+
+local curcontext="$curcontext" state line cmds ret=1
+
+_arguments -C \
+ '(- 1 *)'{-v,--version}'[display version information]' \
+ '(-h|--help)'{-h,--help}'[show help information]' \
+ '1: :->cmds' \
+ '*: :->args' && ret=0
+
+case $state in
+ cmds)
+ cmds=(
+ "version:Prints Gas's version"
+ "use:Uses author"
+ "show:Shows your current user"
+ "list:Lists your authors"
+ "import:Imports current user to gasconfig"
+ "help:Describe available tasks or one specific task"
+ "delete:Deletes author"
+ "add:Adds author to gasconfig"
+ )
+ _describe -t commands 'gas command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ (use|delete)
+ _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
+ ;;
+ esac
+ ;;
+esac
+
+return ret