Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/cargo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0ac0a1870037cfa8429ffa7231a83a00f11aaf62
Choose a base ref
..
head repository: rust-lang/cargo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 61f6e074e13d3de028e69f9e9d614303fd18ff9e
Choose a head ref
Showing with 17 additions and 7 deletions.
  1. +9 −5 src/bin/cargo/commands/add.rs
  2. +8 −2 tests/testsuite/cargo_add/help/stdout.log
14 changes: 9 additions & 5 deletions src/bin/cargo/commands/add.rs
Original file line number Diff line number Diff line change
@@ -65,16 +65,20 @@ The package will be removed from your features.")
flag("public", "Mark the dependency as public (unstable)")
.conflicts_with("dev")
.conflicts_with("build")
.long_help("Mark the dependency as public (unstable)
.long_help("Mark the dependency as public
The dependency can be referenced in your library's public API."),
flag("no-public", "Mark the dependency as private")
The dependency can be referenced in your library's public API.
Unstable (nightly-only) <https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency> "),
flag("no-public", "Mark the dependency as private (unstable)")
.conflicts_with("dev")
.conflicts_with("build")
.overrides_with("public")
.long_help("Mark the dependency as private (unstable)
.long_help("Mark the dependency as private
While you can use the crate in your implementation, it cannot be referenced in your public API.
While you can use the crate in your implementation, it cannot be referenced in your public API."),
Unstable (nightly-only) <https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency>"),
clap::Arg::new("rename")
.long("rename")
.action(ArgAction::Set)
10 changes: 8 additions & 2 deletions tests/testsuite/cargo_add/help/stdout.log
Original file line number Diff line number Diff line change
@@ -33,15 +33,21 @@ Options:
The package will be removed from your features.

--public
Mark the dependency as public (unstable)
Mark the dependency as public

The dependency can be referenced in your library's public API.

Unstable (nightly-only)
<https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency>

--no-public
Mark the dependency as private (unstable)
Mark the dependency as private

While you can use the crate in your implementation, it cannot be referenced in your public
API.

Unstable (nightly-only)
<https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency>

--rename <NAME>
Rename the dependency