-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds a mechanism to hide groups but have their options visible as part of the parent. This works for option group names starting with a '+' for example ``` CLI::App app; bool flag = false; std::optional<bool> optional_flag = std::nullopt; app.add_option("--tester"); auto *m1=app.add_option_group("+tester"); m1->add_option("--flag", flag, "description"); m1->add_option("--optional_flag", optional_flag, "description"); CLI11_PARSE(app,argc, argv); ``` will produce help as ```txt Options: -h,--help Print this help message and exit --tester --flag BOOLEAN description --optional_flag BOOLEAN description ``` instead of ``` Options: -h,--help Print this help message and exit --tester [Option Group: tester] Options: --flag BOOLEAN description --optional_flag BOOLEAN description ``` Fixes issue #1034 and a few other past issues or questions --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ccd6801
commit 08d840b
Showing
6 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters