prezto_config/plugins/gas/_gas

37 lines
835 B
Text
Raw Normal View History

#compdef gas
2011-08-31 05:16:15 +02:00
#autoload
local curcontext="$curcontext" state line cmds ret=1
_arguments -C \
2011-08-31 05:16:15 +02:00
'(- 1 *)'{-v,--version}'[display version information]' \
'(-h|--help)'{-h,--help}'[show help information]' \
'1: :->cmds' \
'*: :->args' && ret=0
2011-08-31 05:16:15 +02:00
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
2011-08-31 05:16:15 +02:00