Don't show options in usage unless there are any.

24 views
Skip to first unread message

theonlygusti

unread,
Jan 26, 2017, 8:43:47 AM1/26/17
to jcommander
Because of this line the usage will always show options, even if there aren't any:

private class CommandTemplate {
  @Parameters
  List<String> parameters = new ArrayList<>();
}

public static void main(String[] args) {
  CommandTemplate template = new CommandTemplate();
  JCommander jcommander = new JCommander(template);
  jcommander.setProgramName("main");
  jcommander.usage();
}

Running the above code will print Usage: main [options] even though there are no options.

Cédric Beust ♔

unread,
Jan 26, 2017, 12:42:22 PM1/26/17
to jcommander
Will be fixed in the next version:


By the way, you should file this as an issue instead of emailing the group.

-- 
Cédric


-- 
Cédric


--
You received this message because you are subscribed to the Google Groups "jcommander" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jcommander+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

theonlygusti

unread,
Jan 26, 2017, 1:04:30 PM1/26/17
to jcommander, ced...@beust.com
I filed it as an issue prior to posting it here. It seems that generally the responses to the mailing group are better than on github though

-- 
Cédric


To unsubscribe from this group and stop receiving emails from it, send an email to jcommander+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages