From 695921954dde46dfd483399dcdef482c9dd7f34a Mon Sep 17 00:00:00 2001 From: Kevin K Date: Tue, 10 May 2016 17:01:12 -0400 Subject: [PATCH] imp(SubCommand Aliases): adds feature to yaml configs too --- src/app/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/mod.rs b/src/app/mod.rs index b3db33907c1..3422913081e 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -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()));