#212 : added -p as an alias for --style=plain

This commit is contained in:
ms2300 2018-08-25 19:44:02 -06:00 committed by David Peter
parent 627181bcb6
commit 81771432fb
1 changed files with 12 additions and 0 deletions

View File

@ -170,6 +170,16 @@ impl App {
components to display (e.g. 'numbers,changes,grid') or a \
pre-defined style ('full')",
),
).arg(
Arg::with_name("plain")
.overrides_with("plain")
.short("p")
.conflicts_with("style")
.help("Show plain style (alias for '--style=plain').")
.long_help(
"Only show plain style, no decorations. This is an alias for \
'--style=plain'",
),
).arg(
Arg::with_name("number")
.long("number")
@ -384,6 +394,8 @@ impl App {
HashSet::new()
} else if matches.is_present("number") {
[OutputComponent::Numbers].iter().cloned().collect()
} else if matches.is_present("plain") {
[OutputComponent::Plain].iter().cloned().collect()
} else {
values_t!(matches.values_of("style"), OutputComponent)?
.into_iter()