diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-06 09:27:49 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-06 09:27:49 +0800 |
| commit | cfb46ca0de8493a1ab5026cd44f88f092b26f91d (patch) | |
| tree | 5b160da9ff653ee5158d5434e5aa6027515c1c92 /src/main.rs | |
| parent | 7def9aef0179ad11ac29e401da8856e972c6ae7b (diff) | |
| download | aichat-cfb46ca0de8493a1ab5026cd44f88f092b26f91d.tar.gz | |
feat: add `--no-highlight` option (#24)
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 0f12db5..884a56f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,10 +43,12 @@ fn main() -> Result<()> { None => None, }; config.borrow_mut().role = role; + if cli.no_highlight { + config.borrow_mut().highlight = false; + } let client = ChatGptClient::init(config.clone())?; if atty::isnt(atty::Stream::Stdin) { let mut input = String::new(); - config.borrow_mut().highlight = false; stdin().read_to_string(&mut input)?; if let Some(text) = text { input = format!("{text}\n{input}"); |
