mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
Merge pull request #2415 from cbzehner/ignore-extra-fields-on-arg
Ignore extra fields in Arg yaml definitions
This commit is contained in:
commit
52814b893c
2 changed files with 3 additions and 4 deletions
|
@ -4712,10 +4712,7 @@ impl<'help> From<&'help Yaml> for Arg<'help> {
|
|||
panic!("Failed to convert YAML value to vector")
|
||||
}
|
||||
}
|
||||
s => panic!(
|
||||
"Unknown Arg setting '{}' in YAML file for arg '{}'",
|
||||
s, name_str
|
||||
),
|
||||
_ => continue, // Ignore extra fields
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
tests/fixtures/app.yaml
vendored
2
tests/fixtures/app.yaml
vendored
|
@ -4,11 +4,13 @@ about: tests clap library
|
|||
author: Kevin K. <kbknapp@gmail.com>
|
||||
settings:
|
||||
- ArgRequiredElseHelp
|
||||
ignored_field: This field is ignored
|
||||
args:
|
||||
- help:
|
||||
short: h
|
||||
long: help
|
||||
about: prints help with a nonstandard description
|
||||
ignored_field: This field is ignored
|
||||
- option:
|
||||
short: o
|
||||
long: option
|
||||
|
|
Loading…
Add table
Reference in a new issue