From c0ebcbe56b89fe96688c4fce88ae5af40132dc42 Mon Sep 17 00:00:00 2001 From: Igor Timoshenko Date: Wed, 12 Feb 2014 16:08:44 +0000 Subject: [PATCH 1/2] Added completion script for Phing --- src/_phing | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/_phing diff --git a/src/_phing b/src/_phing new file mode 100644 index 0000000..57210da --- /dev/null +++ b/src/_phing @@ -0,0 +1,94 @@ +#compdef phing +# ------------------------------------------------------------------------------ +# Copyright (c) Igor M. Timoshenko +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is furnished +# to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for Phing (http://phing.info). +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Igor Timoshenko +# +# ------------------------------------------------------------------------------ + +_phing() { + local context curcontext="$curcontext" state line ret=1 + integer NORMARG + typeset -A opt_args + + # follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information + _arguments \ + '(-h -help)'{-h,-help}'[display the help screen]' \ + '(-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)]' \ + '(-q -quiet)'{-q,-quiet}'[quiet operation, no output at all]' \ + '-verbose[verbose, give some more output]' \ + '-debug[output debug information]' \ + '-logfile [use given file for log]:file:_files' \ + '-D[set the property to the specified value to be used in the buildfile]' \ + '-find []:file:_files' \ + '-buildfile [specify an alternate buildfile name. Default is build.xml]:file:_files' \ + '-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]' \ + '-propertyfile [load properties from the specified file]:file:_files' \ + '(-v --version)'{-v,--version}'[show version]' \ + '1: :->targets' \ + '*:: :->args' \ + && ret=0 + + case $state in + targets) + local buildfile; buildfile=build.xml + if [[ ! -f $buildfile ]] + then + ret=0 + else + local targets; targets=($(sed -nE "/ Date: Wed, 12 Feb 2014 16:25:53 +0000 Subject: [PATCH 2/2] Fixed typo --- src/_phing | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_phing b/src/_phing index 57210da..afdaf3e 100644 --- a/src/_phing +++ b/src/_phing @@ -38,7 +38,7 @@ _phing() { integer NORMARG typeset -A opt_args - # follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information + # Follow http://phing.info/docs/stable/webhelp/sec.commandlineargs.html for more information _arguments \ '(-h -help)'{-h,-help}'[display the help screen]' \ '(-v -version)'{-v,-version}'[print version information and exit]' \