1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00
Philip Top 08d840bfbe
Group merge (#1039)
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>
2024-05-20 11:14:55 -07:00
..
2024-05-20 11:14:55 -07:00
2024-03-19 17:49:34 -07:00
2024-03-19 17:49:34 -07:00
2024-03-19 17:49:34 -07:00
2024-05-20 11:14:55 -07:00
2024-03-19 17:49:34 -07:00
2024-03-19 17:49:34 -07:00
2024-03-19 17:49:34 -07:00
2024-03-19 17:49:34 -07:00