diff options
author | Catherine Noll <noll.catherine@gmail.com> | 2021-03-20 18:46:30 -0500 |
---|---|---|
committer | Catherine Noll <noll.catherine@gmail.com> | 2021-03-20 18:55:24 -0500 |
commit | 587a01ea976dcebadfc5a15b32344fb20b2c96e6 (patch) | |
tree | f0956c7215e4b9277750469b6b71caab9e8cc8fd /src | |
parent | 68296840fa03d229717e9a8451561f3a4510de7f (diff) |
Skeleton for show-themes command line option
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 6 | ||||
-rw-r--r-- | src/main.rs | 7 | ||||
-rw-r--r-- | src/options/set.rs | 1 |
3 files changed, 14 insertions, 0 deletions
@@ -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, |