summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-21 21:17:09 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-21 21:19:21 -0400
commit7d7dd11dc783aca02d2a8af3456e16b4f37efe4e (patch)
tree90acf5d9177b647f443ad5a4d271fd367a886c52
parent284257fde3ab1d5bca489b68d752a9274ae970bb (diff)
Fix test: add missing flags for builtin features
-rw-r--r--src/cli.rs8
-rw-r--r--src/set_options.rs6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 99ba75dc..bdf9617f 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -193,6 +193,14 @@ pub struct Opt {
#[structopt(long = "dark")]
pub dark: bool,
+ #[structopt(long = "diff-highlight")]
+ /// Emulate diff-highlight (https://github.com/git/git/tree/master/contrib/diff-highlight)
+ pub diff_highlight: bool,
+
+ #[structopt(long = "diff-so-fancy")]
+ /// Emulate diff-so-fancy (https://github.com/so-fancy/diff-so-fancy)
+ pub diff_so_fancy: bool,
+
#[structopt(long = "minus-style", default_value = "normal auto")]
/// Style (foreground, background, attributes) for removed lines. See STYLES section.
pub minus_style: String,
diff --git a/src/set_options.rs b/src/set_options.rs
index d456e948..f03373aa 100644
--- a/src/set_options.rs
+++ b/src/set_options.rs
@@ -26,6 +26,12 @@ pub fn set_options(
if opt.color_only {
opt.features = format!("{} color-only", opt.features);
}
+ if opt.diff_highlight {
+ opt.features = format!("{} diff-highlight", opt.features);
+ }
+ if opt.diff_so_fancy {
+ opt.features = format!("{} diff-so-fancy", opt.features);
+ }
if opt.navigate {
opt.features = format!("{} navigate", opt.features);
}