singularity_cli/commands/config.rs
1use anyhow::Result;
2use clap::Subcommand;
3
4#[derive(Subcommand)]
5pub enum ConfigCmd {
6 #[command(
7 name = "set-token",
8 about = "Save API bearer token to ~/.config/singularity/config.toml"
9 )]
10 SetToken {
11 #[arg(help = "API bearer token from Singularity app")]
12 token: String,
13 },
14}
15
16pub fn run(cmd: ConfigCmd) -> Result<()> {
17 match cmd {
18 ConfigCmd::SetToken { token } => crate::config::set_token(&token),
19 }
20}