summaryrefslogtreecommitdiff
path: root/plugins/gas
diff options
context:
space:
mode:
authorRoman Kamyk <roman.kamyk@gmail.com>2011-09-15 12:56:40 +0200
committerRoman Kamyk <roman.kamyk@gmail.com>2011-09-15 12:56:40 +0200
commit2b55ee07534ec34a699805dc35ca83ad8e22fc7a (patch)
tree97f464ca865626aea1aa135e7eb9f629f4017171 /plugins/gas
parentf71647fa85267d558d0d69034902f53aeeed67ad (diff)
parent762b55bb2bc0452ce3f5f2f21bc22b61936ef704 (diff)
downloadzsh-2b55ee07534ec34a699805dc35ca83ad8e22fc7a.tar.gz
zsh-2b55ee07534ec34a699805dc35ca83ad8e22fc7a.tar.bz2
zsh-2b55ee07534ec34a699805dc35ca83ad8e22fc7a.zip
Merge branch 'master' of http://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/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