diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-10-16 21:48:16 -0700 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-10-16 22:00:27 -0700 |
commit | cca2c470a5a9bcd6770c72647038ccf490af14c0 (patch) | |
tree | de50cd483271808afaedc0b43590bb99bd9c3853 /src | |
parent | f08b7a62802065f775b305383cd23844c36a854b (diff) |
Rename CLI option: --show-background-colors
See #31
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 10 | ||||
-rw-r--r-- | src/main.rs | 8 |
2 files changed, 10 insertions, 8 deletions
@@ -76,9 +76,13 @@ pub struct Opt { #[structopt(long = "tabs", default_value = "4")] pub tab_width: usize, - /// Show the command-line arguments for the current colors. - #[structopt(long = "show-colors")] - pub show_colors: bool, + /// Show the command-line arguments (RGB hex codes) for the background colors that are in + /// effect. The hex codes are displayed with their associated background color. This option can + /// be combined with --light and --dark to view the background colors for those modes. It can + /// also be used to experiment with different RGB hex codes by combining this option with + /// --minus-color, --minus-emph-color, --plus-color, --plus-emph-color. + #[structopt(long = "show-background-colors")] + pub show_background_colors: bool, /// List supported languages and associated file extensions. #[structopt(long = "list-languages")] diff --git a/src/main.rs b/src/main.rs index 1ed36e5e..7f4ff061 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,8 +52,8 @@ fn main() -> std::io::Result<()> { let config = cli::process_command_line_arguments(&assets, &opt); - if opt.show_colors { - show_colors(&config); + if opt.show_background_colors { + show_background_colors(&config); process::exit(0); } @@ -75,15 +75,13 @@ fn main() -> std::io::Result<()> { Ok(()) } -fn show_colors(config: &config::Config) { +fn show_background_colors(config: &config::Config) { println!( "delta \ - --theme=\"{theme}\" \ --minus-color=\"{minus_color}\" \ --minus-emph-color=\"{minus_emph_color}\" \ --plus-color=\"{plus_color}\" \ --plus-emph-color=\"{plus_emph_color}\"", - theme = config.theme_name, minus_color = color_to_hex(config.minus_style_modifier.background.unwrap()), minus_emph_color = color_to_hex(config.minus_emph_style_modifier.background.unwrap()), plus_color = color_to_hex(config.plus_style_modifier.background.unwrap()), |