diff options
| -rw-r--r-- | crates/mozart/src/commands/outdated.rs | 6 | ||||
| -rw-r--r-- | crates/mozart/src/commands/show.rs | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/outdated.rs b/crates/mozart/src/commands/outdated.rs index 1807435..5c7b691 100644 --- a/crates/mozart/src/commands/outdated.rs +++ b/crates/mozart/src/commands/outdated.rs @@ -101,6 +101,12 @@ pub async fn execute( cli: &super::Cli, _console: &mozart_core::console::Console, ) -> anyhow::Result<()> { + // Validate mutually exclusive level filters + let level_count = args.major_only as u8 + args.minor_only as u8 + args.patch_only as u8; + if level_count > 1 { + anyhow::bail!("Only one of --major-only, --minor-only or --patch-only can be used at once"); + } + let working_dir = match &cli.working_dir { Some(dir) => PathBuf::from(dir), None => std::env::current_dir()?, diff --git a/crates/mozart/src/commands/show.rs b/crates/mozart/src/commands/show.rs index 7a9eade..4712757 100644 --- a/crates/mozart/src/commands/show.rs +++ b/crates/mozart/src/commands/show.rs @@ -105,6 +105,12 @@ pub async fn execute( cli: &super::Cli, _console: &mozart_core::console::Console, ) -> anyhow::Result<()> { + // Validate mutually exclusive level filters + let level_count = args.major_only as u8 + args.minor_only as u8 + args.patch_only as u8; + if level_count > 1 { + anyhow::bail!("Only one of --major-only, --minor-only or --patch-only can be used at once"); + } + let working_dir = match &cli.working_dir { Some(dir) => PathBuf::from(dir), None => std::env::current_dir()?, |
