Update phing completion to version 3.1.0 and refactoring
This commit is contained in:
parent
7dd5752396
commit
b45ffc1c8a
45
src/_phing
45
src/_phing
|
|
@ -23,7 +23,7 @@
|
||||||
# Description
|
# Description
|
||||||
# -----------
|
# -----------
|
||||||
#
|
#
|
||||||
# Completion script for Phing (https://www.phing.info/).
|
# Completion script for Phing 3.1.0 (https://www.phing.info/).
|
||||||
#
|
#
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Authors
|
# Authors
|
||||||
|
|
@ -39,36 +39,53 @@ _phing() {
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
|
||||||
# Follow https://www.phing.info/guide/chunkhtml/sec.commandlineargs.html for more information
|
# Follow https://www.phing.info/guide/chunkhtml/sec.commandlineargs.html for more information
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'(-h -help)'{-h,-help}'[display the help screen]' \
|
'(-h -help)'{-h,-help}'[display the help screen]' \
|
||||||
'(-v -version)'{-v,-version}'[print version information and exit]' \
|
'(-v -version)'{-v,-version}'[print version information and exit]' \
|
||||||
'(-l -list)'{-l,-list}'[list all available targets in buildfile (excluding targets that have their hidden attribute set to true)]' \
|
'(-l -list)'{-l,-list}'[list all available targets in buildfile]' \
|
||||||
|
'(-i -init)'{-i,-init}'[generates an initial buildfile]:file:_files' \
|
||||||
'(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \
|
'(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \
|
||||||
|
'(-S -silent)'{-S,-silent}'[print nothing but task outputs and build failures]' \
|
||||||
'-verbose[verbose, give some more output]' \
|
'-verbose[verbose, give some more output]' \
|
||||||
'-debug[output debug information]' \
|
'-debug[output debug information]' \
|
||||||
'-logfile [use given file for log]:file:_files' \
|
'(-e -emacs)'{-e,-emacs}'[produce logging information without adornments]' \
|
||||||
'-D[set the property to the specified value to be used in the buildfile]' \
|
'-diagnostics[print diagnostics information]' \
|
||||||
'-find []:file:_files' \
|
'(-strict -no-strict)-strict[run build in strict mode]' \
|
||||||
'-buildfile [specify an alternate buildfile name. Default is build.xml]:file:_files' \
|
'(-strict -no-strict)-no-strict[run build normally]' \
|
||||||
'-logger [specify an alternate logger. Default is phing.listener.DefaultLogger. Other options include phing.listener.NoBannerLogger, phing.listener.AnsiColorLogger, phing.listener.XmlLogger, phing.listener.TargetLogger and phing.listener.HtmlColorLogger]' \
|
'-longtargets[show target descriptions during build]' \
|
||||||
'-propertyfile [load properties from the specified file]:file:_files' \
|
'-logfile[use given file for log]:file:_files' \
|
||||||
'(-v --version)'{-v,--version}'[show version]' \
|
'-logger[the class which is to perform logging]:class' \
|
||||||
|
'*-listener[add an instance of class as a project listener]:class' \
|
||||||
|
'(-f -buildfile)'{-f,-buildfile}'[build file]:file:_files' \
|
||||||
|
'*-D[set the property to the specified value to be used in the buildfile]' \
|
||||||
|
'(-k -keep-going)'{-k,-keep-going}'[execute all targets that do not depend on failed target(s)]' \
|
||||||
|
'-propertyfile[load all properties from the specified file]:file:_files' \
|
||||||
|
'-propertyfileoverride[values in property file override existing values]' \
|
||||||
|
'-find[search for buildfile towards the root of the filesystem and use it]:file:_files' \
|
||||||
|
'-inputhandler[the class to use to handle user input]:class' \
|
||||||
|
'(- *)'{-v,-version}'[show version]' \
|
||||||
'1: :->targets' \
|
'1: :->targets' \
|
||||||
'*:: :->args' \
|
'*:: :->args' \
|
||||||
&& ret=0
|
&& ret=0
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
targets)
|
(targets)
|
||||||
local buildfile; buildfile=build.xml
|
local buildfile=build.xml
|
||||||
|
if (( $+opt_args[-buildfile] )); then
|
||||||
|
buildfile=${opt_args[-buildfile]}
|
||||||
|
elif (($+opt_args[-f] )); then
|
||||||
|
buildfile=${opt_args[-f]}
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -f $buildfile ]]
|
if [[ ! -f $buildfile ]]
|
||||||
then
|
then
|
||||||
ret=0
|
ret=0
|
||||||
else
|
else
|
||||||
local targets; targets=($(sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile))
|
local -a targets=($(sed -nE "/<target /s/.*name=[\"'](\w+)[\"'].*/\1/p" $buildfile))
|
||||||
_describe -t 'targets' 'target' targets && ret=0
|
_describe -t 'targets' 'target' targets && ret=0
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
args)
|
(args)
|
||||||
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
|
if [[ CURRENT -eq NORMARG && ${+opt_args[--match]} -eq 0 ]]
|
||||||
then
|
then
|
||||||
# If the current argument is the first non-option argument
|
# If the current argument is the first non-option argument
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue