Skip to content

Commit d93b018

Browse files
committed
Auto merge of #12276 - dimo414:patch-1, r=weihanglo
Clarify the default behavior of cargo-install. The man page for `cargo install` is not explicit about what the default behavior is. This is important to clarify because `examples/` are typically unneeded and may not be maintained with the same care as "real" binaries, so it should be clear to users that example binaries won't be installed without directly asking for them. Small doc-only update, hopefully this is acceptable. Please let me know if I need to seek further approval first (and, if so, apologies for the noise).
2 parents 0c14026 + 9624861 commit d93b018

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/doc/man/cargo-install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cargo-install --- Build and install a Rust binary
1818
This command manages Cargo's local set of installed binary crates. Only
1919
packages which have executable `[[bin]]` or `[[example]]` targets can be
2020
installed, and all executables are installed into the installation root's
21-
`bin` folder.
21+
`bin` folder. By default only binaries, not examples, are installed.
2222

2323
{{> description-install-root }}
2424

@@ -141,7 +141,7 @@ Install only the specified binary.
141141
{{/option}}
142142

143143
{{#option "`--bins`" }}
144-
Install all binaries.
144+
Install all binaries. This is the default behavior.
145145
{{/option}}
146146

147147
{{#option "`--example` _name_..." }}

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ DESCRIPTION
1313
This command manages Cargo’s local set of installed binary crates.
1414
Only packages which have executable [[bin]] or [[example]] targets can
1515
be installed, and all executables are installed into the installation
16-
root’s bin folder.
16+
root’s bin folder. By default only binaries, not examples, are
17+
installed.
1718

1819
The installation root is determined, in order of precedence:
1920

@@ -137,7 +138,7 @@ OPTIONS
137138
Install only the specified binary.
138139

139140
--bins
140-
Install all binaries.
141+
Install all binaries. This is the default behavior.
141142

142143
--example name…
143144
Install only the specified example.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cargo-install --- Build and install a Rust binary
1818
This command manages Cargo's local set of installed binary crates. Only
1919
packages which have executable `[[bin]]` or `[[example]]` targets can be
2020
installed, and all executables are installed into the installation root's
21-
`bin` folder.
21+
`bin` folder. By default only binaries, not examples, are installed.
2222

2323
The installation root is determined, in order of precedence:
2424

@@ -150,7 +150,7 @@ same time.</dd>
150150

151151

152152
<dt class="option-term" id="option-cargo-install---bins"><a class="option-anchor" href="#option-cargo-install---bins"></a><code>--bins</code></dt>
153-
<dd class="option-desc">Install all binaries.</dd>
153+
<dd class="option-desc">Install all binaries. This is the default behavior.</dd>
154154

155155

156156
<dt class="option-term" id="option-cargo-install---example"><a class="option-anchor" href="#option-cargo-install---example"></a><code>--example</code> <em>name</em>…</dt>

src/etc/man/cargo-install.1

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cargo\-install \[em] Build and install a Rust binary
1717
This command manages Cargo\[cq]s local set of installed binary crates. Only
1818
packages which have executable \fB[[bin]]\fR or \fB[[example]]\fR targets can be
1919
installed, and all executables are installed into the installation root\[cq]s
20-
\fBbin\fR folder.
20+
\fBbin\fR folder. By default only binaries, not examples, are installed.
2121
.sp
2222
The installation root is determined, in order of precedence:
2323
.sp
@@ -177,7 +177,7 @@ Install only the specified binary.
177177
.sp
178178
\fB\-\-bins\fR
179179
.RS 4
180-
Install all binaries.
180+
Install all binaries. This is the default behavior.
181181
.RE
182182
.sp
183183
\fB\-\-example\fR \fIname\fR\[u2026]

0 commit comments

Comments
 (0)