Merge pull request #2415 from cbzehner/ignore-extra-fields-on-arg

Ignore extra fields in Arg yaml definitions
This commit is contained in:
Pavan Kumar Sunkara 2021-03-14 14:00:30 +05:30 committed by GitHub
commit 52814b893c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -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
}
}

View file

@ -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