Skip to content

Commit f141c10

Browse files
committed
doc: add public info in cargo-add man page.
1 parent 8859998 commit f141c10

File tree

6 files changed

+69
-6
lines changed

6 files changed

+69
-6
lines changed

src/bin/cargo/commands/add.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ The package name will be exposed as feature of your crate.")
6262
The package will be removed from your features.")
6363
.conflicts_with("dev")
6464
.overrides_with("optional"),
65-
flag("public", "Mark the dependency as public")
65+
flag("public", "Mark the dependency as public (unstable)")
6666
.conflicts_with("dev")
6767
.conflicts_with("build")
68-
.long_help("Mark the dependency as public
68+
.long_help("Mark the dependency as public (unstable)
6969
7070
The dependency can be referenced in your library's public API."),
71-
flag("no-public", "Mark the dependency as private")
71+
flag("no-public", "Mark the dependency as private (unstable)")
7272
.conflicts_with("dev")
7373
.conflicts_with("build")
7474
.overrides_with("public")
75-
.long_help("Mark the dependency as private
75+
.long_help("Mark the dependency as private (unstable)
7676
7777
While you can use the crate in your implementation, it cannot be referenced in your public API."),
7878
clap::Arg::new("rename")

src/doc/man/cargo-add.md

+16
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ Mark the dependency as [optional](../reference/features.html#optional-dependenci
107107
Mark the dependency as [required](../reference/features.html#optional-dependencies).
108108
{{/option}}
109109

110+
{{#option "`--public`" }}
111+
Mark the dependency as public.
112+
113+
The dependency can be referenced in your library's public API.
114+
115+
[Unstable (nightly-only)](../reference/unstable.html#public-dependency)
116+
{{/option}}
117+
118+
{{#option "`--no-public`" }}
119+
Mark the dependency as private.
120+
121+
While you can use the crate in your implementation, it cannot be referenced in your public API.
122+
123+
[Unstable (nightly-only)](../reference/unstable.html#public-dependency)
124+
{{/option}}
125+
110126
{{#option "`--no-default-features`" }}
111127
Disable the [default features](../reference/features.html#dependency-features).
112128
{{/option}}

src/doc/man/generated_txt/cargo-add.txt

+17
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,23 @@ OPTIONS
9696
Mark the dependency as required
9797
<https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies>.
9898

99+
--public
100+
Mark the dependency as public.
101+
102+
The dependency can be referenced in your library’s public API.
103+
104+
Unstable (nightly-only)
105+
<https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency>
106+
107+
--no-public
108+
Mark the dependency as private.
109+
110+
While you can use the crate in your implementation, it cannot be
111+
referenced in your public API.
112+
113+
Unstable (nightly-only)
114+
<https://doc.rust-lang.org/cargo/reference/unstable.html#public-dependency>
115+
99116
--no-default-features
100117
Disable the default features
101118
<https://doc.rust-lang.org/cargo/reference/features.html#dependency-features>.

src/doc/src/commands/cargo-add.md

+12
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ which is defined by the <code>registry.default</code> config key which defaults
107107
<dd class="option-desc">Mark the dependency as <a href="../reference/features.html#optional-dependencies">required</a>.</dd>
108108

109109

110+
<dt class="option-term" id="option-cargo-add---public"><a class="option-anchor" href="#option-cargo-add---public"></a><code>--public</code></dt>
111+
<dd class="option-desc">Mark the dependency as public. </p>
112+
<p>The dependency can be referenced in your library’s public API.</p>
113+
<p><a href="../reference/unstable.html#public-dependency">Unstable (nightly-only)</a></dd>
114+
115+
116+
<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>
117+
<dd class="option-desc">Mark the dependency as private. </p>
118+
<p>While you can use the crate in your implementation, it cannot be referenced in your public API.</p>
119+
<p><a href="../reference/unstable.html#public-dependency">Unstable (nightly-only)</a></dd>
120+
121+
110122
<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>
111123
<dd class="option-desc">Disable the <a href="../reference/features.html#dependency-features">default features</a>.</dd>
112124

src/etc/man/cargo-add.1

+18
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,24 @@ Mark the dependency as \fIoptional\fR <https://doc.rust\-lang.org/cargo/referenc
121121
Mark the dependency as \fIrequired\fR <https://doc.rust\-lang.org/cargo/reference/features.html#optional\-dependencies>\&.
122122
.RE
123123
.sp
124+
\fB\-\-public\fR
125+
.RS 4
126+
Mark the dependency as public.
127+
.sp
128+
The dependency can be referenced in your library\[cq]s public API.
129+
.sp
130+
\fIUnstable (nightly\-only)\fR <https://doc.rust\-lang.org/cargo/reference/unstable.html#public\-dependency>
131+
.RE
132+
.sp
133+
\fB\-\-no\-public\fR
134+
.RS 4
135+
Mark the dependency as private.
136+
.sp
137+
While you can use the crate in your implementation, it cannot be referenced in your public API.
138+
.sp
139+
\fIUnstable (nightly\-only)\fR <https://doc.rust\-lang.org/cargo/reference/unstable.html#public\-dependency>
140+
.RE
141+
.sp
124142
\fB\-\-no\-default\-features\fR
125143
.RS 4
126144
Disable the \fIdefault features\fR <https://doc.rust\-lang.org/cargo/reference/features.html#dependency\-features>\&.

tests/testsuite/cargo_add/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Options:
3333
The package will be removed from your features.
3434

3535
--public
36-
Mark the dependency as public
36+
Mark the dependency as public (unstable)
3737

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

4040
--no-public
41-
Mark the dependency as private
41+
Mark the dependency as private (unstable)
4242

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

0 commit comments

Comments
 (0)