Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/bin/cargo/commands/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,12 @@ pub fn cli() -> Command {
.arg_message_format()
.arg_silent_suggestion()
.arg_package("Package to document")
.arg_targets_all(
.arg_targets_lib_bin_example(
"Build only this package's library",
"Build only the specified binary",
"Build all binaries",
"Build only the specified example",
"Build all examples",
"Build only the specified test target",
"Build all targets that have `test = true` set",
"Build only the specified bench target",
"Build all targets that have `bench = true` set",
"Build all targets",
)
.arg_features()
.arg_parallel()
Expand Down
14 changes: 13 additions & 1 deletion src/doc/man/cargo-rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,19 @@ binary and library targets of the selected package. The binary will be skipped
if its name is the same as the lib target. Binaries are skipped if they have
`required-features` that are missing.

{{> options-targets }}
{{#options}}
{{> options-targets-lib-bin }}

{{#option "`--example` _name_..." }}
{{actionverb}} the specified example. This flag may be specified multiple times
and supports common Unix glob patterns.
{{/option}}

{{#option "`--examples`" }}
{{actionverb}} all example targets.
{{/option}}

{{/options}}

{{> section-features }}

Expand Down
37 changes: 0 additions & 37 deletions src/doc/man/generated_txt/cargo-rustdoc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ OPTIONS
be skipped if its name is the same as the lib target. Binaries are
skipped if they have required-features that are missing.

Passing target selection flags will document only the specified targets.

Note that --bin, --example, --test and --bench flags also support common
Unix glob patterns like *, ? and []. However, to avoid your shell
accidentally expanding glob patterns before Cargo handles them, you must
use single quotes or double quotes around each glob pattern.

--lib
Document the package’s library.

Expand All @@ -75,36 +68,6 @@ OPTIONS
--examples
Document all example targets.

--test name…
Document the specified integration test. This flag may be specified
multiple times and supports common Unix glob patterns.

--tests
Document all targets that have the test = true manifest flag set. By
default this includes the library and binaries built as unittests,
and integration tests. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as
a unittest, and once as a dependency for binaries, integration
tests, etc.). Targets may be enabled or disabled by setting the test
flag in the manifest settings for the target.

--bench name…
Document the specified benchmark. This flag may be specified
multiple times and supports common Unix glob patterns.

--benches
Document all targets that have the bench = true manifest flag set.
By default this includes the library and binaries built as
benchmarks, and bench targets. Be aware that this will also build
any required dependencies, so the lib target may be built twice
(once as a benchmark, and once as a dependency for binaries,
benchmarks, etc.). Targets may be enabled or disabled by setting the
bench flag in the manifest settings for the target.

--all-targets
Document all targets. This is equivalent to specifying --lib --bins
--tests --benches --examples.

Feature Selection
The feature flags allow you to control which features are enabled. When
no feature options are given, the default feature is activated for every
Expand Down
48 changes: 0 additions & 48 deletions src/doc/src/commands/cargo-rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,7 @@ binary and library targets of the selected package. The binary will be skipped
if its name is the same as the lib target. Binaries are skipped if they have
`required-features` that are missing.

Passing target selection flags will document only the specified
targets.

Note that `--bin`, `--example`, `--test` and `--bench` flags also
support common Unix glob patterns like `*`, `?` and `[]`. However, to avoid your
shell accidentally expanding glob patterns before Cargo handles them, you must
use single quotes or double quotes around each glob pattern.

<dl>

<dt class="option-term" id="option-cargo-rustdoc---lib"><a class="option-anchor" href="#option-cargo-rustdoc---lib"><code>--lib</code></a></dt>
<dd class="option-desc"><p>Document the package’s library.</p>
</dd>
Expand Down Expand Up @@ -104,45 +95,6 @@ and supports common Unix glob patterns.</p>
</dd>


<dt class="option-term" id="option-cargo-rustdoc---test"><a class="option-anchor" href="#option-cargo-rustdoc---test"><code>--test</code> <em>name</em>…</a></dt>
<dd class="option-desc"><p>Document the specified integration test. This flag may be specified
multiple times and supports common Unix glob patterns.</p>
</dd>


<dt class="option-term" id="option-cargo-rustdoc---tests"><a class="option-anchor" href="#option-cargo-rustdoc---tests"><code>--tests</code></a></dt>
<dd class="option-desc"><p>Document all targets that have the <code>test = true</code> manifest
flag set. By default this includes the library and binaries built as
unittests, and integration tests. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
unittest, and once as a dependency for binaries, integration tests, etc.).
Targets may be enabled or disabled by setting the <code>test</code> flag in the
manifest settings for the target.</p>
</dd>


<dt class="option-term" id="option-cargo-rustdoc---bench"><a class="option-anchor" href="#option-cargo-rustdoc---bench"><code>--bench</code> <em>name</em>…</a></dt>
<dd class="option-desc"><p>Document the specified benchmark. This flag may be specified multiple
times and supports common Unix glob patterns.</p>
</dd>


<dt class="option-term" id="option-cargo-rustdoc---benches"><a class="option-anchor" href="#option-cargo-rustdoc---benches"><code>--benches</code></a></dt>
<dd class="option-desc"><p>Document all targets that have the <code>bench = true</code>
manifest flag set. By default this includes the library and binaries built
as benchmarks, and bench targets. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
benchmark, and once as a dependency for binaries, benchmarks, etc.).
Targets may be enabled or disabled by setting the <code>bench</code> flag in the
manifest settings for the target.</p>
</dd>


<dt class="option-term" id="option-cargo-rustdoc---all-targets"><a class="option-anchor" href="#option-cargo-rustdoc---all-targets"><code>--all-targets</code></a></dt>
<dd class="option-desc"><p>Document all targets. This is equivalent to specifying <code>--lib --bins --tests --benches --examples</code>.</p>
</dd>


</dl>

### Feature Selection
Expand Down
47 changes: 0 additions & 47 deletions src/etc/man/cargo-rustdoc.1
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ binary and library targets of the selected package. The binary will be skipped
if its name is the same as the lib target. Binaries are skipped if they have
\fBrequired\-features\fR that are missing.
.sp
Passing target selection flags will document only the specified
targets.
.sp
Note that \fB\-\-bin\fR, \fB\-\-example\fR, \fB\-\-test\fR and \fB\-\-bench\fR flags also
support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, to avoid your
shell accidentally expanding glob patterns before Cargo handles them, you must
use single quotes or double quotes around each glob pattern.
.sp
\fB\-\-lib\fR
.RS 4
Document the package\[cq]s library.
Expand All @@ -86,45 +78,6 @@ and supports common Unix glob patterns.
.RS 4
Document all example targets.
.RE
.sp
\fB\-\-test\fR \fIname\fR\[u2026]
.RS 4
Document the specified integration test. This flag may be specified
multiple times and supports common Unix glob patterns.
.RE
.sp
\fB\-\-tests\fR
.RS 4
Document all targets that have the \fBtest = true\fR manifest
flag set. By default this includes the library and binaries built as
unittests, and integration tests. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
unittest, and once as a dependency for binaries, integration tests, etc.).
Targets may be enabled or disabled by setting the \fBtest\fR flag in the
manifest settings for the target.
.RE
.sp
\fB\-\-bench\fR \fIname\fR\[u2026]
.RS 4
Document the specified benchmark. This flag may be specified multiple
times and supports common Unix glob patterns.
.RE
.sp
\fB\-\-benches\fR
.RS 4
Document all targets that have the \fBbench = true\fR
manifest flag set. By default this includes the library and binaries built
as benchmarks, and bench targets. Be aware that this will also build any
required dependencies, so the lib target may be built twice (once as a
benchmark, and once as a dependency for binaries, benchmarks, etc.).
Targets may be enabled or disabled by setting the \fBbench\fR flag in the
manifest settings for the target.
.RE
.sp
\fB\-\-all\-targets\fR
.RS 4
Document all targets. This is equivalent to specifying \fB\-\-lib \-\-bins \-\-tests \-\-benches \-\-examples\fR\&.
.RE
.SS "Feature Selection"
The feature flags allow you to control which features are enabled. When no
feature options are given, the \fBdefault\fR feature is activated for every
Expand Down
60 changes: 25 additions & 35 deletions tests/testsuite/cargo_rustdoc/help/stdout.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading