Skip to content

Commit

Permalink
feat: add --light-theme option (sigoden#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden authored and rooct committed Nov 30, 2023
1 parent a71d492 commit 6b86157
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
41 changes: 22 additions & 19 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
}
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6b86157

Please sign in to comment.