commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jie...@gmail.com
Subject [CLI] cli2 with subcommands
Date Wed, 02 Apr 2008 14:20:55 GMT
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


Mime
View raw message