JCommander

42 views
Skip to first unread message

jcommanderguy

unread,
Jul 25, 2012, 4:11:50 PM7/25/12
to jcomm...@googlegroups.com
I  want  to actually  print the  usage  when  the  user  launches  the  app without  passing  any  options
app.exe
< should  print usage>

I  dont  see a  way  to  indicate  jcommander  to  do  this.

Also  another  question. Is there  in  built  support  for  showing  the  usage when  user  types  app.exe -help

or  do  I  have  to explicitly process a  help option by  adding  the  below to  the  main options?

@Parameter(names = "--help", help = true)
private boolean help;

Thanks,
Vips

Cédric Beust ♔

unread,
Jul 25, 2012, 4:21:48 PM7/25/12
to jcomm...@googlegroups.com
On Wed, Jul 25, 2012 at 1:11 PM, jcommanderguy <vipi...@gmail.com> wrote:
I  want  to actually  print the  usage  when  the  user  launches  the  app without  passing  any  options
app.exe
< should  print usage>

I  dont  see a  way  to  indicate  jcommander  to  do  this.

Create a new JCommander object and call usage() on it?
 

Also  another  question. Is there  in  built  support  for  showing  the  usage when  user  types  app.exe -help

or  do  I  have  to explicitly process a  help option by  adding  the  below to  the  main options?

@Parameter(names = "--help", help = true)
private boolean help;

Thanks,
Vips

You need to do this ^^^

-- 
Cédric

jcommanderguy

unread,
Jul 25, 2012, 10:16:28 PM7/25/12
to jcomm...@googlegroups.com, ced...@beust.com
What  is  meant  by:-

"You need to do this ^^^ "

Can  you  elaborate?

On Thursday, July 26, 2012 1:51:48 AM UTC+5:30, Cédric Beust ♔ wrote:

Cédric Beust ♔

unread,
Jul 26, 2012, 9:14:36 AM7/26/12
to jcomm...@googlegroups.com
I was pointing "up" to the code that you pasted:

@Parameter(names = "--help", help = true)
private boolean help;


-- 
Cédric

Reply all
Reply to author
Forward
0 new messages