summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-08-01 10:37:06 -0400
committerDan Davison <dandavison7@gmail.com>2020-08-01 11:38:19 -0400
commit5f97f327e3c0cae04790114190639cf929ec9810 (patch)
treea3535029ec25120584f29ac0b7708d34de96fad3 /src/cli.rs
parentc6f66ab8fde78209d395d3502c63da66fae294e0 (diff)
Add inspect-raw-lines {true,false} option
Fixes #72
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 0532a6f2..0729ad3b 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -464,6 +464,12 @@ pub struct Opt {
#[structopt(long = "24-bit-color", default_value = "auto")]
pub true_color: String,
+ /// Whether to examine ANSI color escape sequences in raw lines received from Git and handle
+ /// lines colored in certain ways specially. This is on by default: it is how Delta supports
+ /// Git's --color-moved feature. Set this to "false" to disable this behavior.
+ #[structopt(long = "inspect-raw-lines", default_value = "true")]
+ pub inspect_raw_lines: String,
+
/// Whether to use a pager when displaying output. Options are: auto, always, and never. The
/// default pager is `less`: this can be altered by setting the environment variables BAT_PAGER
/// or PAGER (BAT_PAGER has priority).
@@ -549,6 +555,7 @@ pub struct Opt {
#[derive(Default, Clone, Debug)]
pub struct ComputedValues {
+ pub inspect_raw_lines: InspectRawLines,
pub is_light_mode: bool,
pub syntax_set: SyntaxSet,
pub syntax_theme: Option<SyntaxTheme>,
@@ -572,6 +579,18 @@ impl Default for Width {
}
}
+#[derive(Clone, Debug)]
+pub enum InspectRawLines {
+ True,
+ False,
+}
+
+impl Default for InspectRawLines {
+ fn default() -> Self {
+ InspectRawLines::False
+ }
+}
+
impl Default for PagingMode {
fn default() -> Self {
PagingMode::Never