From 91dee4f1142a2718b8ad193d6839cd428e3ed013 Mon Sep 17 00:00:00 2001 From: Mikko Juola Date: Fri, 17 Mar 2023 23:58:04 -0700 Subject: [PATCH] Add --quiet flag, make colors respect --quiet so you just get the output and nothing else. --- src/rllama_main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rllama_main.rs b/src/rllama_main.rs index d1328be..7a33760 100644 --- a/src/rllama_main.rs +++ b/src/rllama_main.rs @@ -22,6 +22,9 @@ struct Cli { #[arg(long)] param_path: String, + #[arg(short, long, action)] + quiet: bool, + #[arg(long)] prompt: Option, #[arg(long)] @@ -81,6 +84,12 @@ pub fn main() -> Result<(), Box> { if !colored::control::SHOULD_COLORIZE.should_colorize() { be_quiet = true; } + if cli.quiet { + be_quiet = true; + } + if be_quiet { + colored::control::SHOULD_COLORIZE.set_override(false); + } #[cfg(feature = "opencl")] let opencl: Option = {