commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juozas Baliuka <bali...@mwm.lt>
Subject Re: CLI - auto-generated usage message anyone?
Date Wed, 30 Jan 2002 18:04:29 GMT

Hi,
Yes I understand, I mean "does not interpret" doe's not executes user
defined actions then parses command line. May be I wrong, but I don't see 
any interface for this.
It is not very priority. I can do it myself in my application like in this 
pseudo language:

  Loop option in AllOptions
      Handler h = findByOption(option);// option mapped to  handler, my be 
to some predefined
      h.handle(option);
  End

It is very usual in simple situations ( then we don't need look ahead ) and 
can be implemented in CLI.
It can be useful in trivial situations :
mytool -locale LT  -license -help > readme.txt

If you don't understand me, forget this I can always to do in application, 
it is not very useful for me, I see it useful
for some users .


At 04:37 AM 1/29/2002 -0800, you wrote:
>Hi,
>
>What do you mean by "CLI does not interpret cmd"?
>
>Now for the option types let me see what we could
>imagine to have a complete list:
>1. -a, --aaa - no additional argument needed
>2. -a xxx, -aaa xxx - additional argument needed
>3. xxx - only argument
>
>All of those should be either required or optional.
>
>Finally you should be able to say:
>[-a|-b xx|-c xx] -d [-e xx] (-f xx|-g xx) yyy
>
>This means that:
>- the first group [...] is optional but if specified
>must be one of options in brackets
>- -d is mandatory
>- -e has argument and is optional
>- -f or -g is mandatory but only one can be specified
>- finally yyy is argument without option.
>
>I think that it should be possible to check if the
>conditions above are satisfied.
>
>Any thoughts on that?
>
>Best Regards,
>Slawek
>
>
>--- Juozas Baliuka <baliuka@mwm.lt> wrote:
> > Hi,
> > I have suggestion for CLI. CLI does not interpret
> > "cmd" and It is good.
> > But I think it can be useful to add some "CallBack"
> > interface and use it in
> > this way:
> >
> > options.addPredefinedOptions(
> > optionArrayOrSomeFilter );
> > options.addOption(myOption,myHandler);
> >
>..........................................................
> > options.parse( args);//invokes my handler, then
> > finds option in cmd
> >
> > it is possible to implement some samples or helpers
> > or handlers for
> > "standard" or predefined  options like "help"
> >
> > At 02:10 AM 1/29/2002 -0800, you wrote:
> > >Hi,
> > >
> > >I was wondering what do you think if CLI were able
> > (or
> > >maybe is already :-) ) to automatically generate
> > some
> > >sort of "usage: ..." message - something you get
> > when
> > >doing: "man -h".
> > >
> > >Also, does CLI support sub-groups of options, for
> > >example: [-c|-f|-k|-w|-tZT device] -> all being
> > >mutually exclusive?
> > >
> > >Cheers,
> > >Slawek
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Great stuff seeking new owners in Yahoo! Auctions!
> > >http://auctions.yahoo.com
> > >
> > >--
> > >To unsubscribe, e-mail:
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > >For additional commands, e-mail:
> > <mailto:commons-dev-help@jakarta.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:commons-dev-help@jakarta.apache.org>
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Great stuff seeking new owners in Yahoo! Auctions!
>http://auctions.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message