Re: [Console_CommandLine] optional argument not working

From: Date: Tue, 20 Sep 2011 09:53:36 +0000
Subject: Re: [Console_CommandLine] optional argument not working
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-31230@lists.php.net to get a copy of this message
On 20 September 2011 10:46, Reuben Cummings <reubano@gmail.com> wrote: > I couldn't find any way to search the mailing list so hopefully this > hasn't been asked before. How do I get the optional argument to work? > I tried: > > <command> >        <name>textileme</name> >        <argument name="inputFile"> >                <help_name>input-file</help_name> >        </argument> >        <argument name="outputFile"> >                <help_name>output-file</help_name> >                <optional>TRUE</optional> >        </argument> >  </command> > > But I get the following error when run my script with 'textileme argument1' > > PHP Warning:  DOMDocument::relaxNGValidate(): Extra element optional > in interleave in > /usr/local/php5/PEAR/Console/CommandLine/XmlParser.php on line 116 > PHP Warning:  DOMDocument::relaxNGValidate(): Element argument failed > to validate content in > /usr/local/php5/PEAR/Console/CommandLine/XmlParser.php on line 116 > PHP Warning:  DOMDocument::relaxNGValidate(): Extra element argument > in interleave in > /usr/local/php5/PEAR/Console/CommandLine/XmlParser.php on line 116 > PHP Warning:  DOMDocument::relaxNGValidate(): Element command failed > to validate content in > /usr/local/php5/PEAR/Console/CommandLine/XmlParser.php on line 116 > Error: You must provide at least 2 arguments. > Type "textileme --help" to get help. > > > Thanks! > > -- > > Reuben Cummings Just to make my life simpler, can you provide a simple script to show the problem and the config file you are reading from please. Thank you. P.S. You can mail me directly or create a bug in http://pear.php.net/bugs/report.php?package=Console_CommandLine -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

« previous php.pear.general (#31230) next »