Skip to content

Commit

Permalink
Auto merge of #6631 - dwijnand:fix-run-help, r=ehuss
Browse files Browse the repository at this point in the history
Fix run's help message

Fixes #3115
  • Loading branch information
bors committed Feb 5, 2019
2 parents 23fa400 + 96269c2 commit b296129
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Some common cargo commands are (see all commands with --list):
doc Build this package's and its dependencies' documentation
new Create a new cargo package
init Create a new cargo package in an existing directory
run Build and execute src/main.rs
run Run a binary or example of the local package
test Run the tests
bench Run the benchmarks
update Update dependencies listed in Cargo.lock
Expand Down
2 changes: 1 addition & 1 deletion src/bin/cargo/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn cli() -> App {
// subcommand aliases are handled in aliased_command()
// .alias("r")
.setting(AppSettings::TrailingVarArg)
.about("Run the main binary of the local package (src/main.rs)")
.about("Run a binary or example of the local package")
.arg(Arg::with_name("args").multiple(true))
.arg_targets_bin_example(
"Name of the bin target to run",
Expand Down
4 changes: 2 additions & 2 deletions src/doc/man/cargo-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cargo-run - Run the current package

== DESCRIPTION

Build the the main binary of the local package (`src/main.rs`) and run it.
Run a binary or example of the local package.

All the arguments following the two dashes (`--`) are passed to the binary to
run. If you're passing arguments to both Cargo and the binary, the ones after
Expand Down Expand Up @@ -77,7 +77,7 @@ include::section-exit-status.adoc[]

== EXAMPLES

. Build the local package and run its main target:
. Build the local package and run its main target (assuming only one binary):

cargo run

Expand Down
2 changes: 1 addition & 1 deletion src/doc/man/cargo.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ man:cargo-fix[1]::
Automatically fix lint warnings reported by rustc.

man:cargo-run[1]::
Run a binary of the local package.
Run a binary or example of the local package.

man:cargo-rustc[1]::
Compile a package, and pass extra options to the compiler.
Expand Down
11 changes: 9 additions & 2 deletions src/doc/man/generated/cargo-metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ <h2 id="cargo_metadata_output_format">OUTPUT FORMAT</h2>
{
/* The name of the dependency. */
"name": "bitflags",
/* The source ID of the dependency. */
/* The source ID of the dependency. May be null, see
description for the package source.
*/
"source": "registry+https://github.com/rust-lang/crates.io-index",
/* The version requirement for the dependency.
Dependencies without a version requirement have a value of "*".
Expand All @@ -91,7 +93,12 @@ <h2 id="cargo_metadata_output_format">OUTPUT FORMAT</h2>
/* The target platform for the dependency.
null if not a target dependency.
*/
"target": "cfg(windows)"
"target": "cfg(windows)",
/* A string of the URL of the registry this dependency is from.
If not specified or null, the dependency is from the default
registry (crates.io).
*/
"registry": null
}
],
/* Array of Cargo targets. */
Expand Down
4 changes: 2 additions & 2 deletions src/doc/man/generated/cargo-run.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h2 id="cargo_run_synopsis">SYNOPSIS</h2>
<h2 id="cargo_run_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Build the the main binary of the local package (<code>src/main.rs</code>) and run it.</p>
<p>Run a binary or example of the local package.</p>
</div>
<div class="paragraph">
<p>All the arguments following the two dashes (<code>--</code>) are passed to the binary to
Expand Down Expand Up @@ -321,7 +321,7 @@ <h2 id="cargo_run_examples">EXAMPLES</h2>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Build the local package and run its main target:</p>
<p>Build the local package and run its main target (assuming only one binary):</p>
<div class="literalblock">
<div class="content">
<pre>cargo run</pre>
Expand Down
2 changes: 1 addition & 1 deletion src/doc/man/generated/cargo.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h3 id="_build_commands">Build Commands</h3>
</dd>
<dt class="hdlist1"><a href="commands/cargo-run.html">cargo-run(1)</a></dt>
<dd>
<p>Run a binary of the local package.</p>
<p>Run a binary or example of the local package.</p>
</dd>
<dt class="hdlist1"><a href="commands/cargo-rustc.html">cargo-rustc(1)</a></dt>
<dd>
Expand Down
15 changes: 11 additions & 4 deletions src/etc/man/cargo-metadata.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: cargo-metadata
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
.\" Date: 2018-12-23
.\" Date: 2019-01-05
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "CARGO\-METADATA" "1" "2018-12-23" "\ \&" "\ \&"
.TH "CARGO\-METADATA" "1" "2019-01-05" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -82,7 +82,9 @@ The output has the following format:
{
/* The name of the dependency. */
"name": "bitflags",
/* The source ID of the dependency. */
/* The source ID of the dependency. May be null, see
description for the package source.
*/
"source": "registry+https://github.com/rust\-lang/crates.io\-index",
/* The version requirement for the dependency.
Dependencies without a version requirement have a value of "*".
Expand All @@ -105,7 +107,12 @@ The output has the following format:
/* The target platform for the dependency.
null if not a target dependency.
*/
"target": "cfg(windows)"
"target": "cfg(windows)",
/* A string of the URL of the registry this dependency is from.
If not specified or null, the dependency is from the default
registry (crates.io).
*/
"registry": null
}
],
/* Array of Cargo targets. */
Expand Down
8 changes: 4 additions & 4 deletions src/etc/man/cargo-run.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: cargo-run
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
.\" Date: 2018-12-20
.\" Date: 2019-02-05
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "CARGO\-RUN" "1" "2018-12-20" "\ \&" "\ \&"
.TH "CARGO\-RUN" "1" "2019-02-05" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand All @@ -34,7 +34,7 @@ cargo\-run \- Run the current package
\fBcargo run [\fIOPTIONS\fP] [\-\- \fIARGS\fP]\fP
.SH "DESCRIPTION"
.sp
Build the the main binary of the local package (\fBsrc/main.rs\fP) and run it.
Run a binary or example of the local package.
.sp
All the arguments following the two dashes (\fB\-\-\fP) are passed to the binary to
run. If you\(cqre passing arguments to both Cargo and the binary, the ones after
Expand Down Expand Up @@ -328,7 +328,7 @@ Cargo failed to complete.
. sp -1
. IP " 1." 4.2
.\}
Build the local package and run its main target:
Build the local package and run its main target (assuming only one binary):
.sp
.if n .RS 4
.nf
Expand Down
6 changes: 3 additions & 3 deletions src/etc/man/cargo.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
.\" Title: cargo
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 1.5.8
.\" Date: 2018-12-20
.\" Date: 2019-02-05
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "CARGO" "1" "2018-12-20" "\ \&" "\ \&"
.TH "CARGO" "1" "2019-02-05" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand Down Expand Up @@ -85,7 +85,7 @@ Automatically fix lint warnings reported by rustc.
.sp
\fBcargo\-run\fP(1)
.RS 4
Run a binary of the local package.
Run a binary or example of the local package.
.RE
.sp
\fBcargo\-rustc\fP(1)
Expand Down

0 comments on commit b296129

Please sign in to comment.