Skip to content

Commit 7ae60c1

Browse files
fix: enforce mutually exclusive CLI logging arguments
Signed-off-by: Palagiri Subba Reddy <subbareddy123sub@gmail.com>
1 parent b4ad54a commit 7ae60c1

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lore-client/src/cli/cli.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::println;
1717
use crate::styling::cli_styles;
1818
use crate::util::get_repository_path;
1919

20-
// TODO(UCS-12558): Cleanup logging args
2120
#[derive(Parser)]
2221
#[command(name = "lore", styles = cli_styles())]
2322
#[clap(about, long_about = None)]
@@ -31,15 +30,15 @@ pub struct LoreCli {
3130
pub repository: Option<String>,
3231

3332
/// Set the logging level
34-
#[clap(global = true, long = "log-level", value_name = "level")]
33+
#[clap(global = true, long = "log-level", value_name = "level", conflicts_with_all = ["debug", "silent"])]
3534
pub level: Option<String>,
3635

3736
/// Enable debug output
38-
#[clap(global = true, long, short, action)]
37+
#[clap(global = true, long, short, action, conflicts_with_all = ["level", "silent"])]
3938
pub debug: bool,
4039

4140
/// Suppress all output
42-
#[clap(global = true, hide = true, long, short, action)]
41+
#[clap(global = true, hide = true, long, short, action, conflicts_with_all = ["level", "debug"])]
4342
pub silent: bool,
4443

4544
/// Time execution of command

0 commit comments

Comments
 (0)