summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-11-02 16:08:11 +0800
committerGitHub <noreply@github.com>2023-11-02 16:08:11 +0800
commiteff69a482d55d182448ff191203f05efc2878d4c (patch)
tree71c6b261809c5a707fe144ac437f8b3ab6f8c249
parent713c92bdde5435149842b33a55a45f7375c53b60 (diff)
downloadaichat-eff69a482d55d182448ff191203f05efc2878d4c.tar.gz
feat: add `.set auto_copy` (#200)
-rw-r--r--README.md9
-rw-r--r--src/config/mod.rs5
2 files changed, 10 insertions, 4 deletions
diff --git a/README.md b/README.md
index 38db895..00afeb0 100644
--- a/README.md
+++ b/README.md
@@ -149,10 +149,6 @@ Press Ctrl+C to abort readline, Ctrl+D to exit the REPL
```
〉.info
-config_file /home/alice/.config/aichat/config.yaml
-roles_file /home/alice/.config/aichat/roles.yaml
-messages_file /home/alice/.config/aichat/messages.md
-sessions_dir /home/alice/.config/aichat/sessions
model openai:gpt-3.5-turbo
temperature -
save true
@@ -162,6 +158,10 @@ wrap no
wrap_code false
dry_run false
keybindings emacs
+config_file /home/alice/.config/aichat/config.yaml
+roles_file /home/alice/.config/aichat/roles.yaml
+messages_file /home/alice/.config/aichat/messages.md
+sessions_dir /home/alice/.config/aichat/sessions
```
### `.edit` - multiline editing
@@ -258,6 +258,7 @@ compared to the maximum number of tokens allowed by the model.
〉.set dry_run true
〉.set highlight false
〉.set save false
+〉.set auto_copy true
```
## Command Line
diff --git a/src/config/mod.rs b/src/config/mod.rs
index da197b9..1b00832 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -404,6 +404,7 @@ impl Config {
format!("save {}", !self.save),
format!("highlight {}", !self.highlight),
format!("dry_run {}", !self.dry_run),
+ format!("auto_copy {}", !self.auto_copy),
]
}
_ => vec![],
@@ -446,6 +447,10 @@ impl Config {
let value = value.parse().with_context(|| "Invalid value")?;
self.dry_run = value;
}
+ "auto_copy" => {
+ let value = value.parse().with_context(|| "Invalid value")?;
+ self.auto_copy = value;
+ }
_ => bail!("Unknown key `{key}`"),
}
Ok(())