Skip to content

Commit

Permalink
Merge pull request #855 from epage/recursive
Browse files Browse the repository at this point in the history
fix(upgrade)!: Default --recursive to --compatible
  • Loading branch information
epage committed May 23, 2023
2 parents 281f551 + 59b5542 commit ee75d84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Version:
Dependencies:
-p, --package <PKGID[@<VERSION>]> Crate to be upgraded
--exclude <PKGID> Crates to exclude and not upgrade
--recursive [<true|false>] Recursively update locked dependencies [default: true]
--recursive [<true|false>] Recursively update locked dependencies

```

Expand Down
5 changes: 2 additions & 3 deletions src/bin/upgrade/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ pub struct UpgradeArgs {
num_args=0..=1,
action = clap::ArgAction::Set,
value_name = "true|false",
default_value = "true",
default_missing_value = "true",
hide_possible_values = true,
help_heading = "Dependencies"
)]
recursive: bool,
recursive: Option<bool>,
}

impl UpgradeArgs {
Expand Down Expand Up @@ -536,7 +535,7 @@ fn exec(args: UpgradeArgs) -> CargoResult<()> {
locked = metadata.packages;
}

if args.recursive {
if args.recursive.unwrap_or_else(|| args.compatible.as_bool()) {
shell_status("Upgrading", "recursive dependencies")?;
let mut cmd = std::process::Command::new("cargo");
cmd.arg("update");
Expand Down
1 change: 0 additions & 1 deletion tests/cargo-upgrade/to_version/stderr.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
Updating '[ROOTURL]/registry' index
Checking cargo-list-test-fixture's dependencies
Upgrading recursive dependencies

0 comments on commit ee75d84

Please sign in to comment.