diff --git a/src/bin/cargo/commands/add.rs b/src/bin/cargo/commands/add.rs index 55a074282024..58001981da05 100644 --- a/src/bin/cargo/commands/add.rs +++ b/src/bin/cargo/commands/add.rs @@ -62,17 +62,17 @@ The package name will be exposed as feature of your crate.") The package will be removed from your features.") .conflicts_with("dev") .overrides_with("optional"), - flag("public", "Mark the dependency as public") + flag("public", "Mark the dependency as public (unstable)") .conflicts_with("dev") .conflicts_with("build") - .long_help("Mark the dependency as public + .long_help("Mark the dependency as public (unstable) The dependency can be referenced in your library's public API."), flag("no-public", "Mark the dependency as private") .conflicts_with("dev") .conflicts_with("build") .overrides_with("public") - .long_help("Mark the dependency as private + .long_help("Mark the dependency as private (unstable) While you can use the crate in your implementation, it cannot be referenced in your public API."), clap::Arg::new("rename") diff --git a/src/doc/man/cargo-add.md b/src/doc/man/cargo-add.md index d3a62900a062..202dbd5efb3b 100644 --- a/src/doc/man/cargo-add.md +++ b/src/doc/man/cargo-add.md @@ -107,6 +107,18 @@ Mark the dependency as [optional](../reference/features.html#optional-dependenci Mark the dependency as [required](../reference/features.html#optional-dependencies). {{/option}} +{{#option "`--public`" }} +Mark the dependency as public. + +[Unstable (nightly-only)](../reference/unstable.html#public-dependency) +{{/option}} + +{{#option "`--no-public`" }} +Mark the dependency as private. + +[Unstable (nightly-only)](../reference/unstable.html#public-dependency) +{{/option}} + {{#option "`--no-default-features`" }} Disable the [default features](../reference/features.html#dependency-features). {{/option}} diff --git a/src/doc/man/generated_txt/cargo-add.txt b/src/doc/man/generated_txt/cargo-add.txt index 3bd4bd5aa91a..0c1bd49a8ddb 100644 --- a/src/doc/man/generated_txt/cargo-add.txt +++ b/src/doc/man/generated_txt/cargo-add.txt @@ -96,6 +96,18 @@ OPTIONS Mark the dependency as required . + --public + Mark the dependency as public. + + Unstable (nightly-only) + + + --no-public + Mark the dependency as private. + + Unstable (nightly-only) + + --no-default-features Disable the default features . diff --git a/src/doc/src/commands/cargo-add.md b/src/doc/src/commands/cargo-add.md index 68b7c4c364c6..66dc13ee9e46 100644 --- a/src/doc/src/commands/cargo-add.md +++ b/src/doc/src/commands/cargo-add.md @@ -107,6 +107,16 @@ which is defined by the registry.default config key which defaults
Mark the dependency as required.
+
--public
+
Mark the dependency as public.

+

Unstable (nightly-only)

+ + +
--no-public
+
Mark the dependency as private.

+

Unstable (nightly-only)

+ +
--no-default-features
Disable the default features.
diff --git a/src/etc/man/cargo-add.1 b/src/etc/man/cargo-add.1 index 4e8b685667d6..0f49d521adbb 100644 --- a/src/etc/man/cargo-add.1 +++ b/src/etc/man/cargo-add.1 @@ -121,6 +121,20 @@ Mark the dependency as \fIoptional\fR \&. .RE .sp +\fB\-\-public\fR +.RS 4 +Mark the dependency as public. +.sp +\fIUnstable (nightly\-only)\fR +.RE +.sp +\fB\-\-no\-public\fR +.RS 4 +Mark the dependency as private. +.sp +\fIUnstable (nightly\-only)\fR +.RE +.sp \fB\-\-no\-default\-features\fR .RS 4 Disable the \fIdefault features\fR \&. diff --git a/tests/testsuite/cargo_add/help/stdout.log b/tests/testsuite/cargo_add/help/stdout.log index d2931ae9cd41..ee738a3e59cf 100644 --- a/tests/testsuite/cargo_add/help/stdout.log +++ b/tests/testsuite/cargo_add/help/stdout.log @@ -33,12 +33,12 @@ Options: The package will be removed from your features. --public - Mark the dependency as public + Mark the dependency as public (unstable) The dependency can be referenced in your library's public API. --no-public - Mark the dependency as private + Mark the dependency as private (unstable) While you can use the crate in your implementation, it cannot be referenced in your public API.