Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManPageGenerator does not ignore "hidden" options #1063

Closed
bdemers opened this issue May 20, 2020 · 5 comments · Fixed by #1064
Closed

ManPageGenerator does not ignore "hidden" options #1063

bdemers opened this issue May 20, 2020 · 5 comments · Fixed by #1064
Labels
theme: codegen An issue or change related to the picocli-codegen module type: bug 🐛
Milestone

Comments

@bdemers
Copy link
Contributor

bdemers commented May 20, 2020

I was expecting the ManPageGenerator to ignore "hidden" options the same way that the standard --help renderer ignores them, for example:

@Option(names = "--color", hidden = true)
public void setColor(ColorOptions color) { 
  // ...
}

This does NOT render when --help is used, but it IS rendered to the manpage doc:

--color=<color>
@bdemers
Copy link
Contributor Author

bdemers commented May 20, 2020

NOTE: hidden subcommands are rendered as well

@remkop remkop added type: bug 🐛 theme: codegen An issue or change related to the picocli-codegen module labels May 20, 2020
@remkop remkop added this to the 4.4 milestone May 20, 2020
@remkop
Copy link
Owner

remkop commented May 20, 2020

@bdemers Thank you for reporting this!
This is an oversight and a bug.

@remkop
Copy link
Owner

remkop commented May 21, 2020

Will you be able to provide a pull request for this?

@bdemers
Copy link
Contributor Author

bdemers commented May 21, 2020

I think I've got it, doing a bit more testing and I'll send a PR

bdemers added a commit to bdemers/picocli that referenced this issue May 21, 2020
…tion

- Adds a new `CommandLine.CommandSpec.hidden()` method to expose the `Command` annotations `hidden` value.
- Bump project version to 4.4.0 as new public method is added

Fixes: remkop#1063
bdemers added a commit to bdemers/picocli that referenced this issue May 26, 2020
@remkop
Copy link
Owner

remkop commented May 28, 2020

Merged the PR. Thanks for the contribution!

There may be an edge case where options in an argument group (with header) are not hidden, while all other options are hidden; would be good to have a test case for that...
If you can take a look at this that would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: codegen An issue or change related to the picocli-codegen module type: bug 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants