You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of my command classes is using some ArgGroups, for example with headings 'SSC connection options' and 'SSC authentication options'. In the picocli help output, the options are displayed under the correct heading:
However, when generating the asciidoc (using https://github.com/remkop/picocli/tree/main/picocli-codegen#gradle-example-1), the SSC authentication options section is empty, and the options that should appear in that section are displayed under the generic options. The other ArgGroup for connection options is rendered correctly in the asciidoc.
@rsenden Yes you are right. The logic in ManPageGenerator is different from (and not as good as) the logic in CommandLine that generates the usage help message.
ManPageGenerator only considers options in a group if the group they are in has a non-null header text; whereas in CommandLine it also includes options that are in nested subgroups of the group that has a non-null header.
ManPageGenerator should use this logic instead:
privateList<OptionSpec> excludeHiddenAndGroupOptions(List<OptionSpec> all) {
List<OptionSpec> result = newArrayList<OptionSpec>(all);
for (ArgGroupSpecgroup : optionSectionGroups()) { result.removeAll(group.allOptionsNested()); }
for (Iterator<OptionSpec> iter = result.iterator(); iter.hasNext(); ) {
if (iter.next().hidden()) {
iter.remove();
}
}
returnresult;
}
privateList<PositionalParamSpec> excludeHiddenAndGroupParams(List<PositionalParamSpec> all) {
List<PositionalParamSpec> result = newArrayList<PositionalParamSpec>(all);
for (ArgGroupSpecgroup : optionSectionGroups()) { result.removeAll(group.allPositionalParametersNested()); }
for (Iterator<PositionalParamSpec> iter = result.iterator(); iter.hasNext(); ) {
if (iter.next().hidden()) {
iter.remove();
}
}
returnresult;
}
Do you feel like creating a pull request for this?
One of my command classes is using some ArgGroups, for example with headings 'SSC connection options' and 'SSC authentication options'. In the picocli help output, the options are displayed under the correct heading:
However, when generating the asciidoc (using https://github.com/remkop/picocli/tree/main/picocli-codegen#gradle-example-1), the SSC authentication options section is empty, and the options that should appear in that section are displayed under the generic options. The other ArgGroup for connection options is rendered correctly in the asciidoc.
Any idea why this is happening?
Following is a snippet of the command class, full source code is available here: https://github.com/fortify-ps/fcli/blob/c0fb15cc6275fd814e54626cd201feb67f2f16d1/fcli-ssc/src/main/java/com/fortify/cli/ssc/picocli/command/session/SSCSessionLoginCommand.java#L47
The same happens by the way for a similarly structured command class; for this class also the connection options are rendered correctly but the authentication options are not: https://github.com/fortify-ps/fcli/blob/c0fb15cc6275fd814e54626cd201feb67f2f16d1/fcli-fod/src/main/java/com/fortify/cli/fod/picocli/command/session/FoDSessionLoginCommand.java#L47
Using picocli version 4.6.3.
The text was updated successfully, but these errors were encountered: