]> git.rmz.io Git - dotfiles.git/blob - zsh/plugins/gas/_gas
update zshrc
[dotfiles.git] / zsh / plugins / gas / _gas
1 #compdef gas
2
3 local curcontext="$curcontext" state line cmds ret=1
4
5 _arguments -C \
6 '(- 1 *)'{-v,--version}'[display version information]' \
7 '(-h|--help)'{-h,--help}'[show help information]' \
8 '1: :->cmds' \
9 '*: :->args' && ret=0
10
11 case $state in
12 cmds)
13 cmds=(
14 "version:Prints Gas's version"
15 "use:Uses author"
16 "show:Shows your current user"
17 "list:Lists your authors"
18 "import:Imports current user to gasconfig"
19 "help:Describe available tasks or one specific task"
20 "delete:Deletes author"
21 "add:Adds author to gasconfig"
22 )
23 _describe -t commands 'gas command' cmds && ret=0
24 ;;
25 args)
26 case $line[1] in
27 (use|delete)
28 _values -S , 'authors' $(cat ~/.gas | sed -n -e 's/^\[\(.*\)\]/\1/p') && ret=0
29 ;;
30 esac
31 ;;
32 esac
33
34 return ret