mirror of
https://github.com/clap-rs/clap
synced 2024-12-15 15:22:30 +00:00
bd25b5f615
Because we gradually build the `ArgGroup` as we parse the YAML, we don't use `ArgGroup::new`. Clap3 introduced an internal `id` in addition to the public `name` and it appears that this custom initialization code was not updated. This shows the problem with publically exposing `impl Default`. Choices: - Remove `impl Default` - Always valid - Requires spreading invariants - Callers can't implement code the same way we do - Add `ArgGroup::name` - Can be constructed in an invalid state - Centralizes invariants - A caller could implement code like the yaml logic I decided to go with `ArgGroup::name`. Fixes #2719
21 lines
244 B
YAML
21 lines
244 B
YAML
name: app
|
|
|
|
args:
|
|
- arg_1:
|
|
short: a
|
|
- arg_2:
|
|
short: b
|
|
- arg_3:
|
|
short: c
|
|
- arg_4:
|
|
short: d
|
|
|
|
groups:
|
|
- group_1:
|
|
args:
|
|
- arg_1
|
|
- arg_2
|
|
- group_2:
|
|
args:
|
|
- arg_3
|
|
- arg_4
|