From 4ea246fa44530e4a65ca58c33f1df43b95780ef3 Mon Sep 17 00:00:00 2001 From: lkhsss Date: Sun, 7 Sep 2025 15:11:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A2=9C=E8=89=B2=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E7=B3=BB=E7=BB=9F=E4=BD=BF=E7=94=A8`NO=5FCOLOR`?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e95b612..7217e55 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,9 +43,10 @@ fn main() -> Result<(), AppError> { let cli = clap::Cli::parse(); //设置彩色输出 - // let if_colorful = !cli.nocolor; - // colored::control::set_override(if_colorful); - // crossterm::terminal::enable_raw_mode() + if cli.nocolor{ + std::env::set_var("NO_COLOR", "true"); + }; + //FIXME 更改颜色库 //TODO控制颜色输出,更改为使用环境变量