Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
heisen-li committed Dec 12, 2023
1 parent bf304aa commit 05c1653
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cargo-test-macro = { path = "crates/cargo-test-macro" }
cargo-test-support = { path = "crates/cargo-test-support" }
cargo-util = { version = "0.2.6", path = "crates/cargo-util" }
cargo_metadata = "0.18.1"
clap = "4.4.11"
clap = "4.4.10"
color-print = "0.3.5"
core-foundation = { version = "0.9.3", features = ["mac_os_10_7_support"] }
crates-io = { version = "0.39.0", path = "crates/crates-io" }
Expand Down
11 changes: 5 additions & 6 deletions src/bin/cargo/commands/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn cli() -> Command {
.value_delimiter(',')
.value_name("OWNER_NAME")
.hide(true)
.help("Name of the owner you want to invite")
.help("Name of the owner you want to invite"),
)
.args(add_registry_args())
.override_usage(color_print::cstr!(
Expand All @@ -52,7 +52,7 @@ pub fn cli() -> Command {
.value_delimiter(',')
.value_name("OWNER_NAME")
.hide(true)
.help("Name of the owner you want to remove")
.help("Name of the owner you want to remove"),
)
.args(add_registry_args())
.override_usage(color_print::cstr!(
Expand All @@ -76,8 +76,7 @@ pub fn cli() -> Command {

fn add_registry_args() -> [Arg; 4] {
[
opt("crate", "Crate name that you want to manage the owner")
.value_name("CRATE_NAME"),
opt("crate", "Crate name that you want to manage the owner").value_name("CRATE_NAME"),
opt("index", "Registry index URL to modify owners for")
.value_name("INDEX")
.conflicts_with("registry"),
Expand Down Expand Up @@ -112,8 +111,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
),
};

let common_args = args.subcommand().map(|(_, args)| args).unwrap_or(args);

if (to_add.clone(), to_remove.clone(), list) == (None, None, false) {
return Err(CliError::new(
anyhow::format_err!(
Expand All @@ -124,6 +121,8 @@ enter `cargo owner --help` for help."
));
}

let common_args = args.subcommand().map(|(_, args)| args).unwrap_or(args);

let opts = OwnersOptions {
krate: common_args.clone().get_one::<String>("crate").cloned(),
token: common_args
Expand Down

0 comments on commit 05c1653

Please sign in to comment.