Re: Console_CommandLine problem?
| From: | Jake Conk | Date: | Sun, 27 Jan 2008 04:46:12 +0000 |
| Subject: | Re: Console_CommandLine problem? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28471@lists.php.net to get a copy of this message | ||
David,
Thanks for everything, that solves my problem :) Is there a way to
configure the line width to go to the end of the console then wrap
instead having a fixed line width? And lastly is there a way to put
some spacing between each help option so that there is probably a new
line between each option?
Thanks again,
- Jake
On Jan 26, 2008 2:43 AM, David Jean Louis <izimobil@gmail.com> wrote:
>
> > What I noticed is that its only leaving 7 character spaces for stuff
> > in the description column thus making it hard to read. Also it has for
> > every long_name option that gets a value equal to its name which is
> > taking up a lot of space and maybe thats the cause of this?
> >
> > Anyways, is there a way to get my descriptions to display properly and
> > if possible change the long_name=name part to maybe just output
> > longname?
> >
>
> By default Console_CommandLine wraps lines at 75 chars, you can change
> this by doing something like:
>
> $parser = new Console_CommandLine();
> $parser->renderer->line_width = 100; // for example
>
>
> As for the value displayed after short and long options that expect a
> value, by default it's the *option name* that is displayed, but you can
> control this with the *help_name* attribute, for example:
>
>
> $parser->addOption('sequence_table_suffix', array(
> 'short_name' => '-f',
> 'long_name' => '--sequence_table_suffix',
> 'action' => 'StoreString',
> 'help_name' => 'suffix', // this will be displayed after the
> "=" sign
> 'description' => 'Suffix used to find which tables are sequences.'
> ));
>
>
> That said, independently of Console_CommandLine, try to keep you option
> long names short, for exemple "current_engine" can be replaced by
> "engine", "sequence_table_suffix" by "suffix" etc...
> It will be easier for users of your command line program.
>
> HTH.
>
> David.
>
>