Skip to content

Commit

Permalink
doc: add public info in cargo-add man page.
Browse files Browse the repository at this point in the history
  • Loading branch information
linyihai committed Jan 8, 2024
1 parent 8859998 commit ee34a27
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bin/cargo/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,18 @@ The package will be removed from your features.")
.conflicts_with("build")
.long_help("Mark the dependency as public
The dependency can be referenced in your library's public API."),
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")
.conflicts_with("dev")
.conflicts_with("build")
.overrides_with("public")
.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)
Expand Down
12 changes: 12 additions & 0 deletions src/doc/man/cargo-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
12 changes: 12 additions & 0 deletions src/doc/man/generated_txt/cargo-add.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,18 @@ OPTIONS
Mark the dependency as required
<https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies>.

--public
Mark the dependency as public.

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

--no-public
Mark the dependency as private.

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

--no-default-features
Disable the default features
<https://doc.rust-lang.org/cargo/reference/features.html#dependency-features>.
Expand Down
10 changes: 10 additions & 0 deletions src/doc/src/commands/cargo-add.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ which is defined by the <code>registry.default</code> config key which defaults
<dd class="option-desc">Mark the dependency as <a href="../reference/features.html#optional-dependencies">required</a>.</dd>


<dt class="option-term" id="option-cargo-add---public"><a class="option-anchor" href="#option-cargo-add---public"></a><code>--public</code></dt>
<dd class="option-desc">Mark the dependency as public. </p>
<p><a href="../reference/unstable.html#public-dependency">Unstable (nightly-only)</a></dd>


<dt class="option-term" id="option-cargo-add---no-public"><a class="option-anchor" href="#option-cargo-add---no-public"></a><code>--no-public</code></dt>
<dd class="option-desc">Mark the dependency as private. </p>
<p><a href="../reference/unstable.html#public-dependency">Unstable (nightly-only)</a></dd>


<dt class="option-term" id="option-cargo-add---no-default-features"><a class="option-anchor" href="#option-cargo-add---no-default-features"></a><code>--no-default-features</code></dt>
<dd class="option-desc">Disable the <a href="../reference/features.html#dependency-features">default features</a>.</dd>

Expand Down
14 changes: 14 additions & 0 deletions src/etc/man/cargo-add.1
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ Mark the dependency as \fIoptional\fR <https://doc.rust\-lang.org/cargo/referenc
Mark the dependency as \fIrequired\fR <https://doc.rust\-lang.org/cargo/reference/features.html#optional\-dependencies>\&.
.RE
.sp
\fB\-\-public\fR
.RS 4
Mark the dependency as public.
.sp
\fIUnstable (nightly\-only)\fR <https://doc.rust\-lang.org/cargo/reference/unstable.html#public\-dependency>
.RE
.sp
\fB\-\-no\-public\fR
.RS 4
Mark the dependency as private.
.sp
\fIUnstable (nightly\-only)\fR <https://doc.rust\-lang.org/cargo/reference/unstable.html#public\-dependency>
.RE
.sp
\fB\-\-no\-default\-features\fR
.RS 4
Disable the \fIdefault features\fR <https://doc.rust\-lang.org/cargo/reference/features.html#dependency\-features>\&.
Expand Down

0 comments on commit ee34a27

Please sign in to comment.