Skip to content

Commit

Permalink
imp(SubCommand Aliases): adds feature to yaml configs too
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed May 10, 2016
1 parent 1de71c0 commit 6959219
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.parse().ok().expect("unknown AppSetting found in YAML file"));
}
}
}
if let Some(v) = yaml["args"].as_vec() {
for arg_yaml in v {
a = a.arg(Arg::from_yaml(&arg_yaml.as_hash().unwrap()));
Expand Down

0 comments on commit 6959219

Please sign in to comment.