diff options
| author | sigoden <sigoden@gmail.com> | 2023-10-29 17:36:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-29 17:36:17 +0800 |
| commit | 632a6fcc0bfb5b33858cd0fa3876e43ce2073cb3 (patch) | |
| tree | 1f83d5b39e5dbf7fbe5060a1e61eed44e2a84299 | |
| parent | 1ced15a2098f1469b2dd7d59636fdcdc710efc22 (diff) | |
| download | aichat-632a6fcc0bfb5b33858cd0fa3876e43ce2073cb3.tar.gz | |
feat: add `--light-theme` option (#169)
| -rw-r--r-- | src/cli.rs | 41 | ||||
| -rw-r--r-- | src/main.rs | 3 |
2 files changed, 25 insertions, 19 deletions
@@ -4,39 +4,42 @@ use clap::Parser; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct Cli { - /// Choose a model + /// List all models + #[clap(long)] + pub list_models: bool, + /// Choose a llm model #[clap(short, long)] pub model: Option<String>, + /// List all roles + #[clap(long)] + pub list_roles: bool, + /// Select a role + #[clap(short, long)] + pub role: Option<String>, /// Add a GPT prompt #[clap(short, long)] pub prompt: Option<String>, + /// List sessions + #[clap(long)] + pub list_sessions: bool, + /// Initiate or continue a session + #[clap(short = 's', long)] + pub session: Option<Option<String>>, + /// Print information + #[clap(long)] + pub info: bool, + /// Use light theme + #[clap(long)] + pub light_theme: bool, /// Disable syntax highlighting #[clap(short = 'H', long)] pub no_highlight: bool, /// No stream output #[clap(short = 'S', long)] pub no_stream: bool, - /// List all roles - #[clap(long)] - pub list_roles: bool, - /// List all models - #[clap(long)] - pub list_models: bool, - /// Select a role - #[clap(short, long)] - pub role: Option<String>, - /// Print system-wide information - #[clap(long)] - pub info: bool, /// Run in dry run mode #[clap(long)] pub dry_run: bool, - /// List sessions - #[clap(long)] - pub list_sessions: bool, - /// Initiate or continue named session - #[clap(short = 's', long)] - pub session: Option<Option<String>>, /// Input text text: Vec<String>, } diff --git a/src/main.rs b/src/main.rs index de798ec..d2660a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,6 +47,9 @@ fn main() -> Result<()> { println!("{sessions}"); exit(0); } + if cli.light_theme { + config.write().light_theme = true; + } if cli.dry_run { config.write().dry_run = true; } |
