Skip to content

Commit 66a6f3f

Browse files
committed
fix(help): Consistently use SCREAMING_CASE for value names
- We have some positional value names that are SCREAMING_CASE and some that aren't - All of the value names for our flags are already SCREAMING_CASE
1 parent 87f4b1b commit 66a6f3f

File tree

34 files changed

+66
-46
lines changed

34 files changed

+66
-46
lines changed

src/bin/cargo/commands/bench.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub fn cli() -> Command {
1212
)
1313
.arg(
1414
Arg::new("args")
15+
.value_name("ARGS")
1516
.help("Arguments for the bench binary")
1617
.num_args(0..)
1718
.last(true),

src/bin/cargo/commands/init.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ use cargo::ops;
55
pub fn cli() -> Command {
66
subcommand("init")
77
.about("Create a new cargo package in an existing directory")
8-
.arg(Arg::new("path").action(ArgAction::Set).default_value("."))
8+
.arg(
9+
Arg::new("path")
10+
.value_name("PATH")
11+
.action(ArgAction::Set)
12+
.default_value("."),
13+
)
914
.arg_new_opts()
1015
.arg_registry("Registry to use")
1116
.arg_quiet()

src/bin/cargo/commands/install.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ use cargo_util::paths;
1616
pub fn cli() -> Command {
1717
subcommand("install")
1818
.about("Install a Rust binary. Default location is $HOME/.cargo/bin")
19-
.arg(Arg::new("crate").value_parser(parse_crate).num_args(0..))
19+
.arg(
20+
Arg::new("crate")
21+
.value_name("CRATE")
22+
.value_parser(parse_crate)
23+
.num_args(0..),
24+
)
2025
.arg(
2126
opt("version", "Specify a version to install")
2227
.alias("vers")

src/bin/cargo/commands/login.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::command_prelude::*;
66
pub fn cli() -> Command {
77
subcommand("login")
88
.about("Log in to a registry.")
9-
.arg(Arg::new("token").action(ArgAction::Set))
9+
.arg(Arg::new("token").value_name("TOKEN").action(ArgAction::Set))
1010
.arg_registry("Registry to use")
1111
.arg(
1212
Arg::new("args")

src/bin/cargo/commands/new.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ use cargo::ops;
55
pub fn cli() -> Command {
66
subcommand("new")
77
.about("Create a new cargo package at <path>")
8-
.arg(Arg::new("path").action(ArgAction::Set).required(true))
8+
.arg(
9+
Arg::new("path")
10+
.value_name("PATH")
11+
.action(ArgAction::Set)
12+
.required(true),
13+
)
914
.arg_new_opts()
1015
.arg_registry("Registry to use")
1116
.arg_quiet()

src/bin/cargo/commands/owner.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo_credential::Secret;
66
pub fn cli() -> Command {
77
subcommand("owner")
88
.about("Manage the owners of a crate on the registry")
9-
.arg(Arg::new("crate").action(ArgAction::Set))
9+
.arg(Arg::new("crate").value_name("CRATE").action(ArgAction::Set))
1010
.arg(
1111
multi_opt(
1212
"add",

src/bin/cargo/commands/pkgid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo::util::print_available_packages;
66
pub fn cli() -> Command {
77
subcommand("pkgid")
88
.about("Print a fully qualified package specification")
9-
.arg(Arg::new("spec").action(ArgAction::Set))
9+
.arg(Arg::new("spec").value_name("SPEC").action(ArgAction::Set))
1010
.arg_quiet()
1111
.arg_package("Argument to get the package ID specifier for")
1212
.arg_manifest_path()

src/bin/cargo/commands/run.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub fn cli() -> Command {
1616
.about("Run a binary or example of the local package")
1717
.arg(
1818
Arg::new("args")
19+
.value_name("ARGS")
1920
.help("Arguments for the binary or example to run")
2021
.value_parser(value_parser!(OsString))
2122
.num_args(0..)

src/bin/cargo/commands/rustc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub fn cli() -> Command {
1010
.about("Compile a package, and pass extra options to the compiler")
1111
.arg(
1212
Arg::new("args")
13+
.value_name("ARGS")
1314
.num_args(0..)
1415
.help("Extra rustc flags")
1516
.trailing_var_arg(true),

src/bin/cargo/commands/rustdoc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn cli() -> Command {
77
.about("Build a package's documentation, using specified custom flags.")
88
.arg(
99
Arg::new("args")
10+
.value_name("ARGS")
1011
.help("Extra rustdoc flags")
1112
.num_args(0..)
1213
.trailing_var_arg(true),

src/bin/cargo/commands/search.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use cargo::ops;
77
pub fn cli() -> Command {
88
subcommand("search")
99
.about("Search packages in crates.io")
10-
.arg(Arg::new("query").num_args(0..))
10+
.arg(Arg::new("query").value_name("QUERY").num_args(0..))
1111
.arg(
1212
opt(
1313
"limit",

src/bin/cargo/commands/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub fn cli() -> Command {
1313
)
1414
.arg(
1515
Arg::new("args")
16+
.value_name("ARGS")
1617
.help("Arguments for the test binary")
1718
.num_args(0..)
1819
.last(true),

src/bin/cargo/commands/uninstall.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use cargo::ops;
55
pub fn cli() -> Command {
66
subcommand("uninstall")
77
.about("Remove a Rust binary")
8-
.arg(Arg::new("spec").num_args(0..))
8+
.arg(Arg::new("spec").value_name("SPEC").num_args(0..))
99
.arg(opt("root", "Directory to uninstall packages from").value_name("DIR"))
1010
.arg_quiet()
1111
.arg_package_spec_simple("Package to uninstall")

src/bin/cargo/commands/yank.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use cargo_credential::Secret;
66
pub fn cli() -> Command {
77
subcommand("yank")
88
.about("Remove a pushed crate from the index")
9-
.arg(Arg::new("crate").action(ArgAction::Set))
9+
.arg(Arg::new("crate").value_name("CRATE").action(ArgAction::Set))
1010
.arg(
1111
opt("version", "The version to yank or un-yank")
1212
.alias("vers")

tests/testsuite/cargo_bench/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Execute all benchmarks of a local package
22

3-
Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [args]...]
3+
Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [ARGS]...]
44

55
Arguments:
66
[BENCHNAME] If specified, only run benches containing this string in their names
7-
[args]... Arguments for the bench binary
7+
[ARGS]... Arguments for the bench binary
88

99
Options:
1010
--no-run Compile, but don't run benchmarks

tests/testsuite/cargo_bench/no_keep_going/stderr.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ error: unexpected argument '--keep-going' found
22

33
tip: use `--no-fail-fast` to run as many tests as possible regardless of failure
44

5-
Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [args]...]
5+
Usage: cargo[EXE] bench [OPTIONS] [BENCHNAME] [-- [ARGS]...]
66

77
For more information, try '--help'.

tests/testsuite/cargo_init/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Create a new cargo package in an existing directory
22

3-
Usage: cargo[EXE] init [OPTIONS] [path]
3+
Usage: cargo[EXE] init [OPTIONS] [PATH]
44

55
Arguments:
6-
[path] [default: .]
6+
[PATH] [default: .]
77

88
Options:
99
--vcs <VCS> Initialize a new repository for the given version control system,

tests/testsuite/cargo_init/unknown_flags/stderr.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ error: unexpected argument '--flag' found
22

33
tip: to pass '--flag' as a value, use '-- --flag'
44

5-
Usage: cargo[EXE] init <path>
5+
Usage: cargo[EXE] init <PATH>
66

77
For more information, try '--help'.

tests/testsuite/cargo_install/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Install a Rust binary. Default location is $HOME/.cargo/bin
22

3-
Usage: cargo[EXE] install [OPTIONS] [crate]...
3+
Usage: cargo[EXE] install [OPTIONS] [CRATE]...
44

55
Arguments:
6-
[crate]...
6+
[CRATE]...
77

88
Options:
99
--version <VERSION> Specify a version to install

tests/testsuite/cargo_login/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Log in to a registry.
22

3-
Usage: cargo[EXE] login [OPTIONS] [token] [-- [args]...]
3+
Usage: cargo[EXE] login [OPTIONS] [TOKEN] [-- [args]...]
44

55
Arguments:
6-
[token]
6+
[TOKEN]
77
[args]... Additional arguments for the credential provider
88

99
Options:

tests/testsuite/cargo_new/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Create a new cargo package at <path>
22

3-
Usage: cargo[EXE] new [OPTIONS] <path>
3+
Usage: cargo[EXE] new [OPTIONS] <PATH>
44

55
Arguments:
6-
<path>
6+
<PATH>
77

88
Options:
99
--vcs <VCS> Initialize a new repository for the given version control system,

tests/testsuite/cargo_owner/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Manage the owners of a crate on the registry
22

3-
Usage: cargo[EXE] owner [OPTIONS] [crate]
3+
Usage: cargo[EXE] owner [OPTIONS] [CRATE]
44

55
Arguments:
6-
[crate]
6+
[CRATE]
77

88
Options:
99
-a, --add <LOGIN> Name of a user or team to invite as an owner

tests/testsuite/cargo_pkgid/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Print a fully qualified package specification
22

3-
Usage: cargo[EXE] pkgid [OPTIONS] [spec]
3+
Usage: cargo[EXE] pkgid [OPTIONS] [SPEC]
44

55
Arguments:
6-
[spec]
6+
[SPEC]
77

88
Options:
99
-q, --quiet Do not print cargo log messages

tests/testsuite/cargo_run/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Run a binary or example of the local package
22

3-
Usage: cargo[EXE] run [OPTIONS] [args]...
3+
Usage: cargo[EXE] run [OPTIONS] [ARGS]...
44

55
Arguments:
6-
[args]... Arguments for the binary or example to run
6+
[ARGS]... Arguments for the binary or example to run
77

88
Options:
99
--ignore-rust-version Ignore `rust-version` specification in packages

tests/testsuite/cargo_rustc/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Compile a package, and pass extra options to the compiler
22

3-
Usage: cargo[EXE] rustc [OPTIONS] [args]...
3+
Usage: cargo[EXE] rustc [OPTIONS] [ARGS]...
44

55
Arguments:
6-
[args]... Extra rustc flags
6+
[ARGS]... Extra rustc flags
77

88
Options:
99
--print <INFO> Output compiler information without compiling

tests/testsuite/cargo_rustdoc/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Build a package's documentation, using specified custom flags.
22

3-
Usage: cargo[EXE] rustdoc [OPTIONS] [args]...
3+
Usage: cargo[EXE] rustdoc [OPTIONS] [ARGS]...
44

55
Arguments:
6-
[args]... Extra rustdoc flags
6+
[ARGS]... Extra rustdoc flags
77

88
Options:
99
--open Opens the docs in a browser after the operation

tests/testsuite/cargo_search/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Search packages in crates.io
22

3-
Usage: cargo[EXE] search [OPTIONS] [query]...
3+
Usage: cargo[EXE] search [OPTIONS] [QUERY]...
44

55
Arguments:
6-
[query]...
6+
[QUERY]...
77

88
Options:
99
--limit <LIMIT> Limit the number of results (default: 10, max: 100)

tests/testsuite/cargo_test/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Execute all unit and integration tests and build examples of a local package
22

3-
Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [args]...]
3+
Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [ARGS]...]
44

55
Arguments:
66
[TESTNAME] If specified, only run tests containing this string in their names
7-
[args]... Arguments for the test binary
7+
[ARGS]... Arguments for the test binary
88

99
Options:
1010
--doc Test only this library's documentation

tests/testsuite/cargo_test/no_keep_going/stderr.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ error: unexpected argument '--keep-going' found
22

33
tip: use `--no-fail-fast` to run as many tests as possible regardless of failure
44

5-
Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [args]...]
5+
Usage: cargo[EXE] test [OPTIONS] [TESTNAME] [-- [ARGS]...]
66

77
For more information, try '--help'.

tests/testsuite/cargo_uninstall/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Remove a Rust binary
22

3-
Usage: cargo[EXE] uninstall [OPTIONS] [spec]...
3+
Usage: cargo[EXE] uninstall [OPTIONS] [SPEC]...
44

55
Arguments:
6-
[spec]...
6+
[SPEC]...
77

88
Options:
99
--root <DIR> Directory to uninstall packages from

tests/testsuite/cargo_yank/help/stdout.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Remove a pushed crate from the index
22

3-
Usage: cargo[EXE] yank [OPTIONS] [crate]
3+
Usage: cargo[EXE] yank [OPTIONS] [CRATE]
44

55
Arguments:
6-
[crate]
6+
[CRATE]
77

88
Options:
99
--version <VERSION> The version to yank or un-yank

tests/testsuite/install.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ fn inline_version_without_name() {
16141614
cargo_process("install @0.1.1")
16151615
.with_status(1)
16161616
.with_stderr(
1617-
"error: invalid value '@0.1.1' for '[crate]...': missing crate name before '@'
1617+
"error: invalid value '@0.1.1' for '[CRATE]...': missing crate name before '@'
16181618
16191619
For more information, try '--help'.
16201620
",
@@ -1844,7 +1844,7 @@ fn install_empty_argument() {
18441844
cargo_process("install")
18451845
.arg("")
18461846
.with_status(1)
1847-
.with_stderr_contains("[ERROR] invalid value '' for '[crate]...': crate name is empty")
1847+
.with_stderr_contains("[ERROR] invalid value '' for '[CRATE]...': crate name is empty")
18481848
.run();
18491849
}
18501850

@@ -2455,7 +2455,7 @@ error: unexpected argument '--release' found
24552455
24562456
tip: `--release` is the default for `cargo install`; instead `--debug` is supported
24572457
2458-
Usage: cargo[EXE] install [OPTIONS] [crate]...
2458+
Usage: cargo[EXE] install [OPTIONS] [CRATE]...
24592459
24602460
For more information, try '--help'.
24612461
",

tests/testsuite/new.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn no_argument() {
124124
.with_stderr_contains(
125125
"\
126126
error: the following required arguments were not provided:
127-
<path>
127+
<PATH>
128128
",
129129
)
130130
.run();

tests/testsuite/run.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ error: unexpected argument '--silent' found
5050
5151
tip: a similar argument exists: '--quiet'
5252
53-
Usage: cargo[EXE] run [OPTIONS] [args]...
53+
Usage: cargo[EXE] run [OPTIONS] [ARGS]...
5454
5555
For more information, try '--help'.
5656
",
@@ -65,7 +65,7 @@ error: unexpected argument '--silent' found
6565
6666
tip: a similar argument exists: '--quiet'
6767
68-
Usage: cargo[EXE] run [OPTIONS] [args]...
68+
Usage: cargo[EXE] run [OPTIONS] [ARGS]...
6969
7070
For more information, try '--help'.
7171
",

0 commit comments

Comments
 (0)