reworked compl, add help for commands

This commit is contained in:
Mario Fernandez 2011-07-18 23:49:23 +02:00
commit b36273c733

View file

@ -1,9 +1,13 @@
#compdef play #compdef play
#autoload #autoload
local -a subcmds local curcontext="$curcontext" state line cmds ret=1
subcmds=( _arguments \
'1: :->cmds' \
'*:: :->args' && ret=0
cmds=(
'antify:Create a build.xml file for this project' 'antify:Create a build.xml file for this project'
'auto-test:Automatically run all application tests' 'auto-test:Automatically run all application tests'
'build-module:Build and package a module' 'build-module:Build and package a module'
@ -39,10 +43,54 @@ subcmds=(
'war:Export the application as a standalone WAR archive' 'war:Export the application as a standalone WAR archive'
) )
_arguments \ case $state in
'*:: :->subcmds' && return 0 cmds)
_describe -t commands "play command" cmds && ret=0
;;
if (( CURRENT == 1 )); then args)
_describe -t commands "play subcommand" subcmds case $line[1] in
return help)
fi _values 'commands' \
'antify' \
'auto-test' \
'build-module' \
'check' \
'classpath' \
'clean' \
'dependencies' \
'eclipsify' \
'evolutions' \
'evolutions\:apply' \
'evolutions\:mark' \
'evolutions\:resolve' \
'id' \
'idealize' \
'install' \
'javadoc' \
'list-modules' \
'modules' \
'netbeansify' \
'new' \
'new-module' \
'out' \
'pid' \
'precompile' \
'restart' \
'run' \
'secret' \
'start' \
'status' \
'stop' \
'test' \
'war' \
&& ret=0
;;
*)
(( ret )) && _message 'no more arguments'
;;
esac
;;
esac
return ret