Skip to content

Commit ed77ef3

Browse files
committed
Fix pypi flag behavior
1 parent b19d2ab commit ed77ef3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/cli.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::path::PathBuf;
22

3-
use clap::ArgAction;
43
use clap_verbosity_flag::{ErrorLevel, Verbosity};
54

65
use clap::Parser;
@@ -41,11 +40,11 @@ pub enum CondaDenyCliConfig {
4140
environment: Option<Vec<String>>,
4241

4342
/// Check against OSI licenses instead of custom license whitelists.
44-
#[arg(short, long, action = ArgAction::SetTrue)]
43+
#[arg(short, long)]
4544
osi: Option<bool>,
4645

4746
/// Ignore when encountering pypi packages instead of failing.
48-
#[arg(long, action = ArgAction::SetTrue)]
47+
#[arg(long)]
4948
ignore_pypi: Option<bool>,
5049
},
5150
/// List all packages and their licenses in your conda or pixi environment
@@ -133,7 +132,7 @@ mod tests {
133132

134133
#[test]
135134
fn test_cli_with_check_arguments() {
136-
let cli = Cli::try_parse_from(vec!["conda-deny", "check", "--osi"]).unwrap();
135+
let cli = Cli::try_parse_from(vec!["conda-deny", "check", "--osi", "true"]).unwrap();
137136
match cli.command {
138137
CondaDenyCliConfig::Check { osi, .. } => {
139138
assert_eq!(osi, Some(true));

src/license_whitelist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ mod tests {
269269
.unwrap();
270270

271271
// Assert the result
272-
assert_eq!(safe_licenses.len(), 4);
272+
assert_eq!(safe_licenses.len(), 5);
273273
assert!(safe_licenses.iter().any(|e| e.to_string() == "MIT"));
274274
assert!(safe_licenses.iter().any(|e| e.to_string() == "Apache-2.0"));
275275
assert_eq!(ignore_packages.len(), 1);

0 commit comments

Comments
 (0)