summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Karlis <alexanderkarlis@gmail.com>2020-08-15 23:12:33 -0400
committerDavid Peter <sharkdp@users.noreply.github.com>2020-09-14 11:24:14 +0200
commit565a80305ca045e40eb5ba4b2fa127eb9d63e027 (patch)
tree66dcaadca7acfc13f409d16d98ea9891a317bafd /src
parent57a8122a6b9e77f9d1814b1c76823e21267f907f (diff)
Added new alias for 'decoration=always'
Diffstat (limited to 'src')
-rw-r--r--src/bin/bat/app.rs3
-rw-r--r--src/bin/bat/clap_app.rs9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs
index 6c61215e..bb74b873 100644
--- a/src/bin/bat/app.rs
+++ b/src/bin/bat/app.rs
@@ -174,7 +174,8 @@ impl App {
term_width: maybe_term_width.unwrap_or(Term::stdout().size().1 as usize),
loop_through: !(self.interactive_output
|| self.matches.value_of("color") == Some("always")
- || self.matches.value_of("decorations") == Some("always")),
+ || (self.matches.value_of("decorations") == Some("always")
+ || self.matches.is_present("always-decorations"))),
tab_width: self
.matches
.value_of("tabs")
diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs
index aa032a52..eed59a54 100644
--- a/src/bin/bat/clap_app.rs
+++ b/src/bin/bat/clap_app.rs
@@ -258,6 +258,15 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
),
)
.arg(
+ Arg::with_name("always-decorations")
+ .short("D")
+ .alias("always-decor")
+ .overrides_with("always-decorations")
+ .hidden(true)
+ .hidden_short_help(true)
+ .help("Alias for '--decorations=always'")
+ )
+ .arg(
Arg::with_name("paging")
.long("paging")
.overrides_with("paging")