summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCatherine Noll <noll.catherine@gmail.com>2021-03-20 18:46:30 -0500
committerCatherine Noll <noll.catherine@gmail.com>2021-03-20 18:55:24 -0500
commit587a01ea976dcebadfc5a15b32344fb20b2c96e6 (patch)
treef0956c7215e4b9277750469b6b71caab9e8cc8fd /src
parent68296840fa03d229717e9a8451561f3a4510de7f (diff)
Skeleton for show-themes command line option
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs6
-rw-r--r--src/main.rs7
-rw-r--r--src/options/set.rs1
3 files changed, 14 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 41f6eb89..78c3e179 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -270,6 +270,12 @@ pub struct Opt {
#[structopt(long = "show-syntax-themes")]
pub show_syntax_themes: bool,
+ /// Show all available delta themes, each with an example of highlighted diff output.
+ /// If diff output is supplied on standard input then this will be used for the demo. For
+ /// example: `git show --color=always | delta --show-themes`.
+ #[structopt(long = "show-themes")]
+ pub show_themes: bool,
+
#[structopt(long = "no-gitconfig")]
/// Do not take any settings from git config. See GIT CONFIG section.
pub no_gitconfig: bool,
diff --git a/src/main.rs b/src/main.rs
index 5757fbab..35662b45 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,6 +65,9 @@ fn run_app() -> std::io::Result<i32> {
} else if opt.show_syntax_themes {
show_syntax_themes()?;
return Ok(0);
+ } else if opt.show_themes {
+ show_themes()?;
+ return Ok(0);
}
let _show_config = opt.show_config;
@@ -302,6 +305,10 @@ where
}
}
+fn show_themes() -> std::io::Result<()> {
+ Ok(())
+}
+
#[cfg(not(tarpaulin_include))]
fn show_syntax_themes() -> std::io::Result<()> {
let mut opt = cli::Opt::from_args();
diff --git a/src/options/set.rs b/src/options/set.rs
index 354eeea6..e5c1edf0 100644
--- a/src/options/set.rs
+++ b/src/options/set.rs
@@ -169,6 +169,7 @@ pub fn set_options(
plus_empty_line_marker_style,
plus_non_emph_style,
raw,
+ show_themes,
side_by_side,
tab_width,
tokenization_regex,