From a9123e176afc069dd15aff221be26654ea81429e Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 17 Jan 2024 14:15:30 +0900 Subject: [PATCH] Use only XQ_COLORS for colors and drop fallback to JQ_COLORS --- src/bin/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/main.rs b/src/bin/main.rs index 1de8933..597e58a 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -151,7 +151,7 @@ fn init_log(verbosity: &Verbosity) -> Result<()> { fn get_json_style() -> colored_json::Styler { fn set_env_colors(styler: &mut colored_json::Styler) -> Result<()> { - if let Ok(env_colors) = std::env::var("XQ_COLORS").or_else(|_| std::env::var("JQ_COLORS")) { + if let Ok(env_colors) = std::env::var("XQ_COLORS") { let env_colors = env_colors.split(':'); for (i, env_color) in env_colors.enumerate().take(7) { let styles = match i { @@ -204,7 +204,8 @@ fn get_json_style() -> colored_json::Styler { nil_value: colored_json::Style::new(colored_json::Color::Default).dimmed(), ..Default::default() }; - set_env_colors(&mut styler).unwrap_or_else(|_| eprintln!("Failed to set $JQ_COLORS")); + set_env_colors(&mut styler) + .unwrap_or_else(|_| eprintln!("Failed to set colors from $XQ_COLORS")); styler }