diff --git a/src/app/mod.rs b/src/app/mod.rs index 9fa181ee..4473f9a1 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1460,6 +1460,7 @@ impl<'a> From<&'a Yaml> for App<'a, 'a> { } yaml_str!(a, yaml, version); + yaml_str!(a, yaml, author); yaml_str!(a, yaml, bin_name); yaml_str!(a, yaml, about); yaml_str!(a, yaml, before_help); diff --git a/tests/yaml.rs b/tests/yaml.rs index 968489a7..279b9876 100644 --- a/tests/yaml.rs +++ b/tests/yaml.rs @@ -24,3 +24,17 @@ fn help_message() { assert!(help_string.contains( "-h, --help prints help with a nonstandard description\n")); } + +#[test] +fn author() { + let yml = load_yaml!("app.yml"); + let mut app = App::from_yaml(yml); + // Generate the full help message! + let _ = app.get_matches_from_safe_borrow(Vec::::new()); + + let mut help_buffer = Vec::new(); + app.write_help(&mut help_buffer).unwrap(); + let help_string = String::from_utf8(help_buffer).unwrap(); + assert!(help_string.contains( + "Kevin K. ")); +}