-
Notifications
You must be signed in to change notification settings - Fork 440
Open
Labels
theme: arg-groupAn issue or change related to argument groupsAn issue or change related to argument groupstheme: usagehelpAn issue or change related to the usage help messageAn issue or change related to the usage help messagetype: bug 🐛
Milestone
Description
Test code:
@Command(name = "test", sortOptions = false)
public static class Test {
@ArgGroup(exclusive = false, heading = "Outer group\n", order = 10)
private Outer outer;
private static class Outer {
@Option(names = "--outer-opt", description = "Outer option")
private String oo;
@ArgGroup(exclusive = false, heading = "Nested group\n", order = 20)
private Nested nested;
}
private static class Nested {
@Option(names = "--nested-opt", description = "Nested option")
private String no;
}
public static void main(String[] args) {
new CommandLine(new Test()).usage(System.out);
}
}
Expected output:
Usage: test [[--outer-opt=<oo>] [[--nested-opt=<no>]]]
Outer group
--outer-opt=<oo> Outer option
Nested group
--nested-opt=<no> Nested option
Actual
Usage: test [[--outer-opt=<oo>] [[--nested-opt=<no>]]]
Outer group
--outer-opt=<oo> Outer option
--nested-opt=<no> Nested option
Nested group
If I switch the order, everything works as expected - the nested option is in the nested group.
Tested against v4.7.7 and current master.
Metadata
Metadata
Assignees
Labels
theme: arg-groupAn issue or change related to argument groupsAn issue or change related to argument groupstheme: usagehelpAn issue or change related to the usage help messageAn issue or change related to the usage help messagetype: bug 🐛