Re: [Console_CommandLine] optional argument not working

From: Date: Tue, 20 Sep 2011 15:07:05 +0000
Subject: Re: [Console_CommandLine] optional argument not working
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-31233@lists.php.net to get a copy of this message
Thanks everyone! The example here should be fixed as well in case someone doesn't have the updated version: http://pear.php.net/manual/en/package.console.console-commandline.arguments..php Thanks! FYI, i tried filing a bug but clicking "new bug" just produced a blank screen (both FF and Chrome). On Tue, Sep 20, 2011 at 4:31 PM, Richard Quadling <rquadling@gmail.com> wrote: > 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! > > Using a lowercase 'true' will work. > > This issue has been fixed in the main code. > > http://svn.php.net/viewvc?view=revision&revision=317054 > > Thank you for your report. > > Regards, > > Richard. > > -- > Richard Quadling > Twitter : EE : Zend : PHPDoc > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea > -- _____________________________________ Reuben Cummings Business Development Manager Global Cycle Solutions Arusha, Tanzania--Kijenge/Mwanama http://globalcyclesolutions.com rcummings@globalcyclesolutions.com +255 756 477 319 (vodacom) +255 785 477 319 (zain) +254 717 427 367 (safaricom) +1 (234) 738 2266 (u.s.) gmail/skype/twitter/linkedin - reubano

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