Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/uv-cli/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use uv_cache::Refresh;
use uv_configuration::ConfigSettings;
use uv_resolver::PrereleaseMode;
use uv_settings::{Combine, PipOptions, ResolverInstallerOptions, ResolverOptions};
use uv_warnings::warn_user_once;

use crate::{
BuildOptionsArgs, FetchArgs, IndexArgs, InstallerArgs, Maybe, RefreshArgs, ResolverArgs,
Expand All @@ -14,7 +15,13 @@ pub fn flag(yes: bool, no: bool) -> Option<bool> {
(true, false) => Some(true),
(false, true) => Some(false),
(false, false) => None,
(..) => unreachable!("Clap should make this impossible"),
(..) => {
warn_user_once!(
"Boolean flags on different levels are not correctly supported \
(https://github.com/clap-rs/clap/issues/6049)"
);
Some(true)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want None so the default is chosen? I think I prefer the hard error right now though, tbh, the behavior will just be wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree a hard error is preferable.

}
}
}

Expand Down
Loading