Skip to content

Commit

Permalink
cli: leverage clap's default ArgGroup to handle config --user|--repo
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Oct 17, 2024
1 parent 2112584 commit 9294507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/src/commands/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ use crate::config::ConfigSource;
use crate::ui::Ui;

#[derive(clap::Args, Clone, Debug)]
#[command(group = clap::ArgGroup::new("config_level").multiple(false).required(true))]
#[group(id = "config_level", multiple = false, required = true)]
pub(crate) struct ConfigLevelArgs {
/// Target the user-level config
#[arg(long, group = "config_level")]
#[arg(long)]
user: bool,

/// Target the repo-level config
#[arg(long, group = "config_level")]
#[arg(long)]
repo: bool,
}

Expand Down

0 comments on commit 9294507

Please sign in to comment.