From 58fb982f44724624e03843ecf5aabee36a107be3 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 29 Aug 2023 15:21:02 -0500 Subject: [PATCH] fix(help): Explain --explain In working on #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 #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. --- src/bin/cargo/cli.rs | 8 +++++++- tests/testsuite/cargo/help/stdout.log | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index eb337d681ce..d1ca475f440 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -564,7 +564,13 @@ See 'cargo help ' for more information on a specific command.\n", ) .arg(flag("version", "Print version info and exit").short('V')) .arg(flag("list", "List installed commands")) - .arg(opt("explain", "Run `rustc --explain CODE`").value_name("CODE")) + .arg( + opt( + "explain", + "Provide a detailed explanation of a rustc error message", + ) + .value_name("CODE"), + ) .arg( opt( "verbose", diff --git a/tests/testsuite/cargo/help/stdout.log b/tests/testsuite/cargo/help/stdout.log index 26bcd745bd6..0ae50d0e43c 100644 --- a/tests/testsuite/cargo/help/stdout.log +++ b/tests/testsuite/cargo/help/stdout.log @@ -6,7 +6,7 @@ Usage: cargo [..][OPTIONS] [COMMAND] Options: -V, --version Print version info and exit --list List installed commands - --explain Run `rustc --explain CODE` + --explain Provide a detailed explanation of a rustc error message -v, --verbose... Use verbose output (-vv very verbose/build.rs output) -q, --quiet Do not print cargo log messages --color Coloring: auto, always, never