-
Notifications
You must be signed in to change notification settings - Fork 440
Closed
Labels
Milestone
Description
The generated help with included subcommands, does not show how to apply the subcommand.
For example:
public class DemoApp {
@Command(name = "demo", subcommands = DemoCmd.class)
static class Demo implements Runnable {
@Option(names = {"-h", "--help"}, usageHelp = true)
private boolean help;
public void run() {
System.out.println("Print help message.");
}
}
@Command(name = "cmd")
static class DemoCmd implements Runnable {
@ParentCommand
private Demo parent;
@Override
public void run() {
System.out.println("DONE");
}
}
public static void main(String[] args) {
CommandLine.run(new Demo(), System.out, "-h");
}
}
prints to the console:
Usage: demo [-h]
-h, --help
Commands:
cmd
The user may be asking how to apply the subcommand since it is only showing demo [-h]
.
Could be possible to show for example:
Usage: demo [-h] [command]