From 6b0e2f742319254007a06580e9ce9530a2d944d4 Mon Sep 17 00:00:00 2001 From: QiangHeisenberg Date: Thu, 19 Aug 2021 19:23:58 +0800 Subject: [PATCH 1/9] Add cargo doc --examples subcommand --- src/bin/cargo/commands/doc.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index 009bd2bfa34..00b742f2c4e 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -11,6 +11,10 @@ pub fn cli() -> App { .arg(opt( "open", "Opens the docs in a browser after the operation", + )) + .arg(opt( + "examples", + "Document all examples", )) .arg_package_spec( "Package to document", From 16865630d998d2616530f3271c9fb2bf26bafd17 Mon Sep 17 00:00:00 2001 From: heisenberg <46313511+QiangHeisenberg@users.noreply.github.com> Date: Thu, 19 Aug 2021 19:39:40 +0800 Subject: [PATCH 2/9] Update doc.rs --- src/bin/cargo/commands/doc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index 00b742f2c4e..fe8c5cd3e55 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -12,7 +12,7 @@ pub fn cli() -> App { "open", "Opens the docs in a browser after the operation", )) - .arg(opt( + .arg(opt( "examples", "Document all examples", )) From 51d48e96c2e2165bd514930a2db6cc3427f2e5be Mon Sep 17 00:00:00 2001 From: l00556901 Date: Thu, 19 Aug 2021 19:53:28 +0800 Subject: [PATCH 3/9] fmt --- src/bin/cargo/commands/doc.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index fe8c5cd3e55..c96fe10cead 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -12,10 +12,7 @@ pub fn cli() -> App { "open", "Opens the docs in a browser after the operation", )) - .arg(opt( - "examples", - "Document all examples", - )) + .arg(opt("examples", "Document all examples")) .arg_package_spec( "Package to document", "Document all packages in the workspace", From 2929efdf883ae8489916afc6612258b2e827126d Mon Sep 17 00:00:00 2001 From: l00556901 Date: Tue, 24 Aug 2021 17:44:58 +0800 Subject: [PATCH 4/9] add --examples subcommand --- src/bin/cargo/commands/doc.rs | 4 +- src/cargo/util/command_prelude.rs | 8 +- src/doc/man/cargo-doc.md | 2 +- ....md => options-targets-lib-bin-example.md} | 10 ++ tests/testsuite/doc.rs | 103 ++++++++++++++++++ 5 files changed, 121 insertions(+), 6 deletions(-) rename src/doc/man/includes/{options-targets-lib-bin.md => options-targets-lib-bin-example.md} (55%) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index c96fe10cead..d20561b2891 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -21,10 +21,12 @@ pub fn cli() -> App { .arg(opt("no-deps", "Don't build documentation for dependencies")) .arg(opt("document-private-items", "Document private items")) .arg_jobs() - .arg_targets_lib_bin( + .arg_targets_lib_bin_example( "Document only this package's library", "Document only the specified binary", "Document all binaries", + "Document only the specified binary", + "Document all examples", ) .arg_release("Build artifacts in release mode, with optimizations") .arg_profile("Build artifacts with the specified profile") diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 9e893928850..dfbbd6fc140 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -87,9 +87,7 @@ pub trait AppExt: Sized { benches: &'static str, all: &'static str, ) -> Self { - self.arg_targets_lib_bin(lib, bin, bins) - ._arg(optional_multi_opt("example", "NAME", example)) - ._arg(opt("examples", examples)) + self.arg_targets_lib_bin_example(lib, bin, bins, example, examples) ._arg(optional_multi_opt("test", "NAME", test)) ._arg(opt("tests", tests)) ._arg(optional_multi_opt("bench", "NAME", bench)) @@ -97,10 +95,12 @@ pub trait AppExt: Sized { ._arg(opt("all-targets", all)) } - fn arg_targets_lib_bin(self, lib: &'static str, bin: &'static str, bins: &'static str) -> Self { + fn arg_targets_lib_bin_example(self, lib: &'static str, bin: &'static str, bins: &'static str, example: &'static str, examples: &'static str) -> Self { self._arg(opt("lib", lib)) ._arg(optional_multi_opt("bin", "NAME", bin)) ._arg(opt("bins", bins)) + ._arg(optional_multi_opt("example", "NAME", example)) + ._arg(opt("examples", examples)) } fn arg_targets_bins_examples( diff --git a/src/doc/man/cargo-doc.md b/src/doc/man/cargo-doc.md index d7c3dc7299c..5d6e50d871b 100644 --- a/src/doc/man/cargo-doc.md +++ b/src/doc/man/cargo-doc.md @@ -51,7 +51,7 @@ the manifest settings. Using target selection options will ignore the `doc` flag and will always document the given target. {{#options}} -{{> options-targets-lib-bin }} +{{> options-targets-lib-bin-example }} {{/options}} {{> section-features }} diff --git a/src/doc/man/includes/options-targets-lib-bin.md b/src/doc/man/includes/options-targets-lib-bin-example.md similarity index 55% rename from src/doc/man/includes/options-targets-lib-bin.md rename to src/doc/man/includes/options-targets-lib-bin-example.md index 14342acfad9..e2366a1251e 100644 --- a/src/doc/man/includes/options-targets-lib-bin.md +++ b/src/doc/man/includes/options-targets-lib-bin-example.md @@ -10,3 +10,13 @@ and supports common Unix glob patterns. {{#option "`--bins`" }} {{actionverb}} all binary targets. {{/option}} + +{{#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 examples targets. +{{/option}} + diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index 183420192b6..aa1791e0d1b 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -513,6 +513,109 @@ fn doc_lib_bin_same_name_documents_bins_when_requested() { assert!(doc_html.contains("Binary")); } +#[cargo_test] +fn doc_lib_bin_example_same_name_documents_named_example_when_requested() { + let p = project() + .file( + "src/main.rs", + r#" + //! Binary documentation + extern crate foo; + fn main() { + foo::foo(); + } + "#, + ) + .file( + "src/lib.rs", + r#" + //! Library documentation + pub fn foo() {} + "#, + ) + .file( + "examples/ex1.rs", + r#" + //! Example1 documentation + pub fn x() { f(); } + "#, + ) + .build(); + + p.cargo("doc --example ex1") + .with_stderr( + "\ +[CHECKING] foo v0.0.1 ([CWD]) +[DOCUMENTING] foo v0.0.1 ([CWD]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", + ) + .run(); + + let doc_html = p.read_file("target/doc/ex1/index.html"); + assert!(!doc_html.contains("Library")); + assert!(!doc_html.contains("Binary")); + assert!(doc_html.contains("Example1")); +} + +#[cargo_test] +fn doc_lib_bin_example_same_name_documents_examples_when_requested() { + let p = project() + .file( + "src/main.rs", + r#" + //! Binary documentation + extern crate foo; + fn main() { + foo::foo(); + } + "#, + ) + .file( + "src/lib.rs", + r#" + //! Library documentation + pub fn foo() {} + "#, + ) + .file( + "examples/ex1.rs", + r#" + //! Example1 documentation + pub fn example1() { f(); } + "#, + ) + .file( + "examples/ex2.rs", + r#" + //! Example2 documentation + pub fn example2() { f(); } + "#, + ) + .build(); + + p.cargo("doc --examples") + .with_stderr( + "\ +[CHECKING] foo v0.0.1 ([CWD]) +[DOCUMENTING] foo v0.0.1 ([CWD]) +[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]", + ) + .run(); + + let example_doc_html_1 = p.read_file("target/doc/ex1/index.html"); + let example_doc_html_2 = p.read_file("target/doc/ex2/index.html"); + + assert!(!example_doc_html_1.contains("Library")); + assert!(!example_doc_html_1.contains("Binary")); + + assert!(!example_doc_html_2.contains("Library")); + assert!(!example_doc_html_2.contains("Binary")); + + assert!(example_doc_html_1.contains("Example1")); + assert!(example_doc_html_2.contains("Example2")); +} + + #[cargo_test] fn doc_dash_p() { let p = project() From 1bbd505a72879ac5e2cf8a07f2aff143b149a3c8 Mon Sep 17 00:00:00 2001 From: l00556901 Date: Tue, 24 Aug 2021 17:49:21 +0800 Subject: [PATCH 5/9] add fmt --- src/cargo/util/command_prelude.rs | 9 ++++++++- tests/testsuite/doc.rs | 3 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index dfbbd6fc140..c99b8688f1e 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -95,7 +95,14 @@ pub trait AppExt: Sized { ._arg(opt("all-targets", all)) } - fn arg_targets_lib_bin_example(self, lib: &'static str, bin: &'static str, bins: &'static str, example: &'static str, examples: &'static str) -> Self { + fn arg_targets_lib_bin_example( + self, + lib: &'static str, + bin: &'static str, + bins: &'static str, + example: &'static str, + examples: &'static str, + ) -> Self { self._arg(opt("lib", lib)) ._arg(optional_multi_opt("bin", "NAME", bin)) ._arg(opt("bins", bins)) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index aa1791e0d1b..7ea15c36caa 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -593,7 +593,7 @@ fn doc_lib_bin_example_same_name_documents_examples_when_requested() { ) .build(); - p.cargo("doc --examples") + p.cargo("doc --examples") .with_stderr( "\ [CHECKING] foo v0.0.1 ([CWD]) @@ -615,7 +615,6 @@ fn doc_lib_bin_example_same_name_documents_examples_when_requested() { assert!(example_doc_html_2.contains("Example2")); } - #[cargo_test] fn doc_dash_p() { let p = project() From d26e449bb67dd24c68211666487a52528e82e95b Mon Sep 17 00:00:00 2001 From: l00556901 Date: Tue, 24 Aug 2021 19:06:19 +0800 Subject: [PATCH 6/9] fix bug --- src/bin/cargo/commands/doc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index d20561b2891..11a05c20ed2 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -25,7 +25,7 @@ pub fn cli() -> App { "Document only this package's library", "Document only the specified binary", "Document all binaries", - "Document only the specified binary", + "Document only the specified example", "Document all examples", ) .arg_release("Build artifacts in release mode, with optimizations") From 65c8eb34c7a3b9eebc8f4ffd8b80f4b99eae7335 Mon Sep 17 00:00:00 2001 From: l00556901 Date: Wed, 25 Aug 2021 10:00:19 +0800 Subject: [PATCH 7/9] doc man.page --- src/doc/man/generated_txt/cargo-bench.txt | 10 ---------- src/doc/man/generated_txt/cargo-build.txt | 10 ---------- src/doc/man/generated_txt/cargo-check.txt | 10 ---------- src/doc/man/generated_txt/cargo-doc.txt | 7 +++++++ src/doc/man/generated_txt/cargo-fix.txt | 10 ---------- src/doc/man/generated_txt/cargo-rustc.txt | 10 ---------- src/doc/man/generated_txt/cargo-rustdoc.txt | 10 ---------- src/doc/man/generated_txt/cargo-test.txt | 10 ---------- src/doc/src/commands/cargo-bench.md | 12 ------------ src/doc/src/commands/cargo-build.md | 12 ------------ src/doc/src/commands/cargo-check.md | 12 ------------ src/doc/src/commands/cargo-doc.md | 10 ++++++++++ src/doc/src/commands/cargo-fix.md | 12 ------------ src/doc/src/commands/cargo-rustc.md | 12 ------------ src/doc/src/commands/cargo-rustdoc.md | 12 ------------ src/doc/src/commands/cargo-test.md | 12 ------------ src/etc/man/cargo-bench.1 | 16 ---------------- src/etc/man/cargo-build.1 | 16 ---------------- src/etc/man/cargo-check.1 | 16 ---------------- src/etc/man/cargo-doc.1 | 11 +++++++++++ src/etc/man/cargo-fix.1 | 16 ---------------- src/etc/man/cargo-rustc.1 | 16 ---------------- src/etc/man/cargo-rustdoc.1 | 16 ---------------- src/etc/man/cargo-test.1 | 16 ---------------- 24 files changed, 28 insertions(+), 266 deletions(-) diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index 5a933063709..3e439a1c706 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -118,16 +118,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Benchmark the package's library. - - --bin name... - Benchmark the specified binary. This flag may be specified multiple - times and supports common Unix glob patterns. - - --bins - Benchmark all binary targets. - --example name... Benchmark the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-build.txt b/src/doc/man/generated_txt/cargo-build.txt index 4b321d9f7cb..66146cba1e1 100644 --- a/src/doc/man/generated_txt/cargo-build.txt +++ b/src/doc/man/generated_txt/cargo-build.txt @@ -58,16 +58,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Build the package's library. - - --bin name... - Build the specified binary. This flag may be specified multiple - times and supports common Unix glob patterns. - - --bins - Build all binary targets. - --example name... Build the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-check.txt b/src/doc/man/generated_txt/cargo-check.txt index ce8281c6a27..6139f859c86 100644 --- a/src/doc/man/generated_txt/cargo-check.txt +++ b/src/doc/man/generated_txt/cargo-check.txt @@ -64,16 +64,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Check the package's library. - - --bin name... - Check the specified binary. This flag may be specified multiple - times and supports common Unix glob patterns. - - --bins - Check all binary targets. - --example name... Check the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index 2b34fb93fc7..cdf79e7aee2 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -82,6 +82,13 @@ OPTIONS --bins Document all binary targets. + --example name... + Document the specified example. This flag may be specified multiple + times and supports common Unix glob patterns. + + --examples + Document all examples targets. + 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 diff --git a/src/doc/man/generated_txt/cargo-fix.txt b/src/doc/man/generated_txt/cargo-fix.txt index 450023a7241..ffb37a013e7 100644 --- a/src/doc/man/generated_txt/cargo-fix.txt +++ b/src/doc/man/generated_txt/cargo-fix.txt @@ -137,16 +137,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Fix the package's library. - - --bin name... - Fix the specified binary. This flag may be specified multiple times - and supports common Unix glob patterns. - - --bins - Fix all binary targets. - --example name... Fix the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-rustc.txt b/src/doc/man/generated_txt/cargo-rustc.txt index d8d18ccaedf..f71ba8c2785 100644 --- a/src/doc/man/generated_txt/cargo-rustc.txt +++ b/src/doc/man/generated_txt/cargo-rustc.txt @@ -49,16 +49,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Build the package's library. - - --bin name... - Build the specified binary. This flag may be specified multiple - times and supports common Unix glob patterns. - - --bins - Build all binary targets. - --example name... Build the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-rustdoc.txt b/src/doc/man/generated_txt/cargo-rustdoc.txt index 628bbcfe595..0b337b51093 100644 --- a/src/doc/man/generated_txt/cargo-rustdoc.txt +++ b/src/doc/man/generated_txt/cargo-rustdoc.txt @@ -58,16 +58,6 @@ OPTIONS 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. - - --bin name... - Document the specified binary. This flag may be specified multiple - times and supports common Unix glob patterns. - - --bins - Document all binary targets. - --example name... Document the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-test.txt b/src/doc/man/generated_txt/cargo-test.txt index e554e938c38..d2100a30236 100644 --- a/src/doc/man/generated_txt/cargo-test.txt +++ b/src/doc/man/generated_txt/cargo-test.txt @@ -131,16 +131,6 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. - --lib - Test the package's library. - - --bin name... - Test the specified binary. This flag may be specified multiple times - and supports common Unix glob patterns. - - --bins - Test all binary targets. - --example name... Test the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index ce58f230758..ae42bed88eb 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -140,18 +140,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Benchmark the package's library.
- - -
--bin name...
-
Benchmark the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Benchmark all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md index fb372dc0007..26ced0be2fc 100644 --- a/src/doc/src/commands/cargo-build.md +++ b/src/doc/src/commands/cargo-build.md @@ -76,18 +76,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Build the package's library.
- - -
--bin name...
-
Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Build all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md index 28340b26ac9..13ffda94742 100644 --- a/src/doc/src/commands/cargo-check.md +++ b/src/doc/src/commands/cargo-check.md @@ -81,18 +81,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Check the package's library.
- - -
--bin name...
-
Check the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Check all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 6f8255ca3ab..43746a87780 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -107,6 +107,16 @@ and supports common Unix glob patterns.
Document all binary targets.
+
--example name...
+
Document the specified example. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--examples
+
Document all examples targets.
+ + +
### Feature Selection diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md index 534520188d3..9be4fa11571 100644 --- a/src/doc/src/commands/cargo-fix.md +++ b/src/doc/src/commands/cargo-fix.md @@ -161,18 +161,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Fix the package's library.
- - -
--bin name...
-
Fix the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Fix all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md index 65dbeee3fff..f57c503bd37 100644 --- a/src/doc/src/commands/cargo-rustc.md +++ b/src/doc/src/commands/cargo-rustc.md @@ -63,18 +63,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Build the package's library.
- - -
--bin name...
-
Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Build all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index 96de095f821..b6afb79ee26 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -78,18 +78,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Document the package's library.
- - -
--bin name...
-
Document the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Document all binary targets.
-
--example name...
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index e2daf71f681..aa407f1bdd2 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -148,18 +148,6 @@ use single quotes or double quotes around each glob pattern.
-
--lib
-
Test the package's library.
- - -
--bin name...
-
Test the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns.
- - -
--bins
-
Test all binary targets.
-
--example name...
diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index a8239d002d9..25a16ffcee6 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -145,22 +145,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Benchmark the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Benchmark the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Benchmark all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Benchmark the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1 index 4eaea1bc5a7..b2e21f9fb59 100644 --- a/src/etc/man/cargo-build.1 +++ b/src/etc/man/cargo-build.1 @@ -63,22 +63,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Build the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Build all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Build the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1 index 7c6b2ea17d2..1793b7325ff 100644 --- a/src/etc/man/cargo-check.1 +++ b/src/etc/man/cargo-check.1 @@ -68,22 +68,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Check the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Check the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Check all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Check the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index 3d783b7547b..6c655b17f4d 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -95,6 +95,17 @@ and supports common Unix glob patterns. .RS 4 Document all binary targets. .RE +.sp +\fB\-\-example\fR \fIname\fR\&... +.RS 4 +Document the specified example. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-examples\fR +.RS 4 +Document all examples targets. +.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 diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1 index 57eb1da015f..9c4027a0010 100644 --- a/src/etc/man/cargo-fix.1 +++ b/src/etc/man/cargo-fix.1 @@ -163,22 +163,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Fix the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Fix the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Fix all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Fix the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1 index 5a69821c6e1..65b2bc6b289 100644 --- a/src/etc/man/cargo-rustc.1 +++ b/src/etc/man/cargo-rustc.1 @@ -49,22 +49,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Build the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Build the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Build all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Build the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index 2a9af8cf6b1..5f246fc0770 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -60,22 +60,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Document the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Document all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Document the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index bafeb08662e..b5928bf390e 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -154,22 +154,6 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 -Test the package's library. -.RE -.sp -\fB\-\-bin\fR \fIname\fR\&... -.RS 4 -Test the specified binary. This flag may be specified multiple times -and supports common Unix glob patterns. -.RE -.sp -\fB\-\-bins\fR -.RS 4 -Test all binary targets. -.RE -.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Test the specified example. This flag may be specified multiple times From f2cfd676289228eb4eabd269c95faf876dc3d3ab Mon Sep 17 00:00:00 2001 From: l00556901 Date: Wed, 25 Aug 2021 11:42:35 +0800 Subject: [PATCH 8/9] fix doc --- src/doc/man/cargo-doc.md | 12 +++++++++++- src/doc/man/generated_txt/cargo-bench.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-build.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-check.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-doc.txt | 2 +- src/doc/man/generated_txt/cargo-fix.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-rustc.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-rustdoc.txt | 10 ++++++++++ src/doc/man/generated_txt/cargo-test.txt | 10 ++++++++++ ...lib-bin-example.md => options-targets-lib-bin.md} | 10 ---------- src/doc/src/commands/cargo-bench.md | 12 ++++++++++++ src/doc/src/commands/cargo-build.md | 12 ++++++++++++ src/doc/src/commands/cargo-check.md | 12 ++++++++++++ src/doc/src/commands/cargo-doc.md | 4 ++-- src/doc/src/commands/cargo-fix.md | 12 ++++++++++++ src/doc/src/commands/cargo-rustc.md | 12 ++++++++++++ src/doc/src/commands/cargo-rustdoc.md | 12 ++++++++++++ src/doc/src/commands/cargo-test.md | 12 ++++++++++++ 18 files changed, 168 insertions(+), 14 deletions(-) rename src/doc/man/includes/{options-targets-lib-bin-example.md => options-targets-lib-bin.md} (55%) diff --git a/src/doc/man/cargo-doc.md b/src/doc/man/cargo-doc.md index 5d6e50d871b..b0289a8368f 100644 --- a/src/doc/man/cargo-doc.md +++ b/src/doc/man/cargo-doc.md @@ -51,7 +51,17 @@ the manifest settings. Using target selection options will ignore the `doc` flag and will always document the given target. {{#options}} -{{> options-targets-lib-bin-example }} +{{> 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 }} diff --git a/src/doc/man/generated_txt/cargo-bench.txt b/src/doc/man/generated_txt/cargo-bench.txt index 3e439a1c706..5a933063709 100644 --- a/src/doc/man/generated_txt/cargo-bench.txt +++ b/src/doc/man/generated_txt/cargo-bench.txt @@ -118,6 +118,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Benchmark the package's library. + + --bin name... + Benchmark the specified binary. This flag may be specified multiple + times and supports common Unix glob patterns. + + --bins + Benchmark all binary targets. + --example name... Benchmark the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-build.txt b/src/doc/man/generated_txt/cargo-build.txt index 66146cba1e1..4b321d9f7cb 100644 --- a/src/doc/man/generated_txt/cargo-build.txt +++ b/src/doc/man/generated_txt/cargo-build.txt @@ -58,6 +58,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Build the package's library. + + --bin name... + Build the specified binary. This flag may be specified multiple + times and supports common Unix glob patterns. + + --bins + Build all binary targets. + --example name... Build the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-check.txt b/src/doc/man/generated_txt/cargo-check.txt index 6139f859c86..ce8281c6a27 100644 --- a/src/doc/man/generated_txt/cargo-check.txt +++ b/src/doc/man/generated_txt/cargo-check.txt @@ -64,6 +64,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Check the package's library. + + --bin name... + Check the specified binary. This flag may be specified multiple + times and supports common Unix glob patterns. + + --bins + Check all binary targets. + --example name... Check the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-doc.txt b/src/doc/man/generated_txt/cargo-doc.txt index cdf79e7aee2..de1589d6304 100644 --- a/src/doc/man/generated_txt/cargo-doc.txt +++ b/src/doc/man/generated_txt/cargo-doc.txt @@ -87,7 +87,7 @@ OPTIONS times and supports common Unix glob patterns. --examples - Document all examples targets. + Document all example targets. Feature Selection The feature flags allow you to control which features are enabled. When diff --git a/src/doc/man/generated_txt/cargo-fix.txt b/src/doc/man/generated_txt/cargo-fix.txt index ffb37a013e7..450023a7241 100644 --- a/src/doc/man/generated_txt/cargo-fix.txt +++ b/src/doc/man/generated_txt/cargo-fix.txt @@ -137,6 +137,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Fix the package's library. + + --bin name... + Fix the specified binary. This flag may be specified multiple times + and supports common Unix glob patterns. + + --bins + Fix all binary targets. + --example name... Fix the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-rustc.txt b/src/doc/man/generated_txt/cargo-rustc.txt index f71ba8c2785..d8d18ccaedf 100644 --- a/src/doc/man/generated_txt/cargo-rustc.txt +++ b/src/doc/man/generated_txt/cargo-rustc.txt @@ -49,6 +49,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Build the package's library. + + --bin name... + Build the specified binary. This flag may be specified multiple + times and supports common Unix glob patterns. + + --bins + Build all binary targets. + --example name... Build the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-rustdoc.txt b/src/doc/man/generated_txt/cargo-rustdoc.txt index 0b337b51093..628bbcfe595 100644 --- a/src/doc/man/generated_txt/cargo-rustdoc.txt +++ b/src/doc/man/generated_txt/cargo-rustdoc.txt @@ -58,6 +58,16 @@ OPTIONS 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. + + --bin name... + Document the specified binary. This flag may be specified multiple + times and supports common Unix glob patterns. + + --bins + Document all binary targets. + --example name... Document the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/generated_txt/cargo-test.txt b/src/doc/man/generated_txt/cargo-test.txt index d2100a30236..e554e938c38 100644 --- a/src/doc/man/generated_txt/cargo-test.txt +++ b/src/doc/man/generated_txt/cargo-test.txt @@ -131,6 +131,16 @@ OPTIONS accidentally expanding glob patterns before Cargo handles them, you must use single quotes or double quotes around each glob pattern. + --lib + Test the package's library. + + --bin name... + Test the specified binary. This flag may be specified multiple times + and supports common Unix glob patterns. + + --bins + Test all binary targets. + --example name... Test the specified example. This flag may be specified multiple times and supports common Unix glob patterns. diff --git a/src/doc/man/includes/options-targets-lib-bin-example.md b/src/doc/man/includes/options-targets-lib-bin.md similarity index 55% rename from src/doc/man/includes/options-targets-lib-bin-example.md rename to src/doc/man/includes/options-targets-lib-bin.md index e2366a1251e..14342acfad9 100644 --- a/src/doc/man/includes/options-targets-lib-bin-example.md +++ b/src/doc/man/includes/options-targets-lib-bin.md @@ -10,13 +10,3 @@ and supports common Unix glob patterns. {{#option "`--bins`" }} {{actionverb}} all binary targets. {{/option}} - -{{#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 examples targets. -{{/option}} - diff --git a/src/doc/src/commands/cargo-bench.md b/src/doc/src/commands/cargo-bench.md index ae42bed88eb..ce58f230758 100644 --- a/src/doc/src/commands/cargo-bench.md +++ b/src/doc/src/commands/cargo-bench.md @@ -140,6 +140,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Benchmark the package's library.
+ + +
--bin name...
+
Benchmark the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Benchmark all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md index 26ced0be2fc..fb372dc0007 100644 --- a/src/doc/src/commands/cargo-build.md +++ b/src/doc/src/commands/cargo-build.md @@ -76,6 +76,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Build the package's library.
+ + +
--bin name...
+
Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Build all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md index 13ffda94742..28340b26ac9 100644 --- a/src/doc/src/commands/cargo-check.md +++ b/src/doc/src/commands/cargo-check.md @@ -81,6 +81,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Check the package's library.
+ + +
--bin name...
+
Check the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Check all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md index 43746a87780..774169816c9 100644 --- a/src/doc/src/commands/cargo-doc.md +++ b/src/doc/src/commands/cargo-doc.md @@ -107,14 +107,14 @@ and supports common Unix glob patterns.
Document all binary targets.
+
--example name...
Document the specified example. This flag may be specified multiple times and supports common Unix glob patterns.
--examples
-
Document all examples targets.
- +
Document all example targets.
diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md index 9be4fa11571..534520188d3 100644 --- a/src/doc/src/commands/cargo-fix.md +++ b/src/doc/src/commands/cargo-fix.md @@ -161,6 +161,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Fix the package's library.
+ + +
--bin name...
+
Fix the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Fix all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md index f57c503bd37..65dbeee3fff 100644 --- a/src/doc/src/commands/cargo-rustc.md +++ b/src/doc/src/commands/cargo-rustc.md @@ -63,6 +63,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Build the package's library.
+ + +
--bin name...
+
Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Build all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md index b6afb79ee26..96de095f821 100644 --- a/src/doc/src/commands/cargo-rustdoc.md +++ b/src/doc/src/commands/cargo-rustdoc.md @@ -78,6 +78,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Document the package's library.
+ + +
--bin name...
+
Document the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Document all binary targets.
+
--example name...
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md index aa407f1bdd2..e2daf71f681 100644 --- a/src/doc/src/commands/cargo-test.md +++ b/src/doc/src/commands/cargo-test.md @@ -148,6 +148,18 @@ use single quotes or double quotes around each glob pattern.
+
--lib
+
Test the package's library.
+ + +
--bin name...
+
Test the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns.
+ + +
--bins
+
Test all binary targets.
+
--example name...
From 92c35f250ea0f82dcd214e806b9bc699c34ae142 Mon Sep 17 00:00:00 2001 From: l00556901 Date: Wed, 25 Aug 2021 11:45:22 +0800 Subject: [PATCH 9/9] cancel examples --- src/bin/cargo/commands/doc.rs | 1 - src/etc/man/cargo-bench.1 | 16 ++++++++++++++++ src/etc/man/cargo-build.1 | 16 ++++++++++++++++ src/etc/man/cargo-check.1 | 16 ++++++++++++++++ src/etc/man/cargo-doc.1 | 2 +- src/etc/man/cargo-fix.1 | 16 ++++++++++++++++ src/etc/man/cargo-rustc.1 | 16 ++++++++++++++++ src/etc/man/cargo-rustdoc.1 | 16 ++++++++++++++++ src/etc/man/cargo-test.1 | 16 ++++++++++++++++ 9 files changed, 113 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index 11a05c20ed2..875cfcfcc46 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -12,7 +12,6 @@ pub fn cli() -> App { "open", "Opens the docs in a browser after the operation", )) - .arg(opt("examples", "Document all examples")) .arg_package_spec( "Package to document", "Document all packages in the workspace", diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1 index 25a16ffcee6..a8239d002d9 100644 --- a/src/etc/man/cargo-bench.1 +++ b/src/etc/man/cargo-bench.1 @@ -145,6 +145,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Benchmark the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Benchmark the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Benchmark all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Benchmark the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1 index b2e21f9fb59..4eaea1bc5a7 100644 --- a/src/etc/man/cargo-build.1 +++ b/src/etc/man/cargo-build.1 @@ -63,6 +63,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Build the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Build all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Build the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1 index 1793b7325ff..7c6b2ea17d2 100644 --- a/src/etc/man/cargo-check.1 +++ b/src/etc/man/cargo-check.1 @@ -68,6 +68,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Check the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Check the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Check all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Check the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1 index 6c655b17f4d..045795bb3ac 100644 --- a/src/etc/man/cargo-doc.1 +++ b/src/etc/man/cargo-doc.1 @@ -104,7 +104,7 @@ and supports common Unix glob patterns. .sp \fB\-\-examples\fR .RS 4 -Document all examples targets. +Document all example targets. .RE .SS "Feature Selection" The feature flags allow you to control which features are enabled. When no diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1 index 9c4027a0010..57eb1da015f 100644 --- a/src/etc/man/cargo-fix.1 +++ b/src/etc/man/cargo-fix.1 @@ -163,6 +163,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Fix the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Fix the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Fix all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Fix the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1 index 65b2bc6b289..5a69821c6e1 100644 --- a/src/etc/man/cargo-rustc.1 +++ b/src/etc/man/cargo-rustc.1 @@ -49,6 +49,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Build the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Build the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Build all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Build the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1 index 5f246fc0770..2a9af8cf6b1 100644 --- a/src/etc/man/cargo-rustdoc.1 +++ b/src/etc/man/cargo-rustdoc.1 @@ -60,6 +60,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Document the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Document all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Document the specified example. This flag may be specified multiple times diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1 index b5928bf390e..bafeb08662e 100644 --- a/src/etc/man/cargo-test.1 +++ b/src/etc/man/cargo-test.1 @@ -154,6 +154,22 @@ support common Unix glob patterns like \fB*\fR, \fB?\fR and \fB[]\fR\&. However, 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 +Test the package's library. +.RE +.sp +\fB\-\-bin\fR \fIname\fR\&... +.RS 4 +Test the specified binary. This flag may be specified multiple times +and supports common Unix glob patterns. +.RE +.sp +\fB\-\-bins\fR +.RS 4 +Test all binary targets. +.RE +.sp \fB\-\-example\fR \fIname\fR\&... .RS 4 Test the specified example. This flag may be specified multiple times