mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
imp(SubCommand Aliases): adds feature to yaml configs too
This commit is contained in:
parent
1de71c0058
commit
41a482cf5d
1 changed files with 7 additions and 0 deletions
|
@ -974,6 +974,13 @@ impl<'a> From<&'a Yaml> for App<'a, 'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
if let Some(v) = yaml["aliases"].as_vec() {
|
||||
for ys in v {
|
||||
if let Some(s) = ys.as_str() {
|
||||
a = a.alias(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(v) = yaml["args"].as_vec() {
|
||||
for arg_yaml in v {
|
||||
a = a.arg(Arg::from_yaml(&arg_yaml.as_hash().unwrap()));
|
||||
|
|
Loading…
Reference in a new issue