Skip to content

Commit 58fb982

Browse files
committed
fix(help): Explain --explain
In working on rust-lang#12578, I'm focusing on each help string to decide how it should be handled and I noticed this. It feels weird to explain something in terms of another command's CLI, so I took `rustc --help`s message and added `rustc` to clarify it. Looking back, the flag was added in rust-lang#2551 with the message we have today. Nothing seems to really be said about it. In reflecting on this, I'm not 100% convinced and am open to other opinions.
1 parent a873df5 commit 58fb982

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/bin/cargo/cli.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,13 @@ See 'cargo help <command>' for more information on a specific command.\n",
564564
)
565565
.arg(flag("version", "Print version info and exit").short('V'))
566566
.arg(flag("list", "List installed commands"))
567-
.arg(opt("explain", "Run `rustc --explain CODE`").value_name("CODE"))
567+
.arg(
568+
opt(
569+
"explain",
570+
"Provide a detailed explanation of a rustc error message",
571+
)
572+
.value_name("CODE"),
573+
)
568574
.arg(
569575
opt(
570576
"verbose",

tests/testsuite/cargo/help/stdout.log

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Usage: cargo [..][OPTIONS] [COMMAND]
66
Options:
77
-V, --version Print version info and exit
88
--list List installed commands
9-
--explain <CODE> Run `rustc --explain CODE`
9+
--explain <CODE> Provide a detailed explanation of a rustc error message
1010
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
1111
-q, --quiet Do not print cargo log messages
1212
--color <WHEN> Coloring: auto, always, never

0 commit comments

Comments
 (0)