You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by ji...@gmail.com on 2008/04/02 16:20:55 UTC

[CLI] cli2 with subcommands

Greetings,

I'm using a CLI2 snapshot and am trying to write a parser for a rather
complex command line tool. I have a series of subcommands but I don't
see any easy way to print out a Help for it. I can easily print out
automatically created Helps for each of the subcommand options, but
nothing at the top level. I'd like to just set up my DisplaySetting
options and dump the entire command with the formatter also handling
any subcommands.

mycmd <global options> <subcmd>
  subcmd1 <local options> <arg1> [<arg2> ...]
  subcmd2 <local options> <arg2> [<arg2> ...]

Also, is there any way to have an optional prefix for the command? I
am writing a robot which has heads on IRC as well as AIM. In IRC, I
only want it to respond when it sees !mycmd but on AIM I want to
respond when it sees mycmd. Right now I'm just testing for !mycmd as
the leading string and removing the ! mark. Perhaps this is good
enough, I was just curious..

Thanks in advance,
-jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org