summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs5
-rw-r--r--src/main.rs4
-rw-r--r--src/repl/mod.rs2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/cli.rs b/src/cli.rs
index e1adde7..5d709ea 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -6,9 +6,12 @@ pub struct Cli {
/// List all roles
#[clap(short = 'L', long)]
pub list_roles: bool,
- /// Specify the role that the AI will play
+ /// Select a role
#[clap(short, long)]
pub role: Option<String>,
+ /// Turn off highlight
+ #[clap(short = 'H', long)]
+ pub no_highlight: bool,
/// Input text, if no input text, enter interactive mode
text: Vec<String>,
}
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}");
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 30f09fe..826ec6a 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -16,7 +16,7 @@ pub use self::handler::*;
pub const REPL_COMMANDS: [(&str, &str, bool); 12] = [
(".info", "Print the information", false),
(".set", "Modify the configuration temporarily", false),
- (".role", "Specifies the role the AI will play", false),
+ (".role", "Select a role", false),
(".clear role", "Clear the currently selected role", false),
(".prompt", "Add prompt, aka create a temporary role", true),
(".history", "Print the history", false),