summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-28 19:18:56 +0800
committerGitHub <noreply@github.com>2024-04-28 19:18:56 +0800
commitd9b8eabf23ae96fb395a8059c1e08840609499f4 (patch)
tree73c69f56c5ecd718daacd9450bb25ec8db0649b1 /src/main.rs
parent4b205c4bac414f625001faa39fe36f9e118dfaa3 (diff)
downloadaichat-d9b8eabf23ae96fb395a8059c1e08840609499f4.tar.gz
feat: add `--prompt` option (#454)
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index f3d3846..f691b6f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -80,7 +80,9 @@ async fn main() -> Result<()> {
if cli.dry_run {
config.write().dry_run = true;
}
- if let Some(name) = &cli.role {
+ if let Some(prompt) = &cli.prompt {
+ config.write().set_prompt(prompt)?;
+ } else if let Some(name) = &cli.role {
config.write().set_role(name)?;
} else if cli.execute {
config.write().set_role(SHELL_ROLE)?;