From 77fbf3e2d24b49bf964c41532e6a516f5347b554 Mon Sep 17 00:00:00 2001 From: dzorya Date: Sat, 4 Nov 2023 20:24:21 +0300 Subject: [PATCH] better help message for MissingPositional error (#10949) Added "Use `--help` for more information." to the help of MissingPositional error - this PR should close [#10946](https://github.com/nushell/nushell/issues/10946) **Before:** ![image](https://github.com/nushell/nushell/assets/1835944/629aeaae-e985-41aa-a791-05ef062e988e) **After:** ![image](https://github.com/nushell/nushell/assets/1835944/0bc1868c-ffed-4440-ad98-2cf29aa8c656) # Description # User-Facing Changes # Tests + Formatting # After Submitting --------- Co-authored-by: Denis Zorya --- crates/nu-protocol/src/parse_error.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/nu-protocol/src/parse_error.rs b/crates/nu-protocol/src/parse_error.rs index 648c1352c2..da763d6a94 100644 --- a/crates/nu-protocol/src/parse_error.rs +++ b/crates/nu-protocol/src/parse_error.rs @@ -339,7 +339,10 @@ pub enum ParseError { OnlyLastFlagInBatchCanTakeArg(#[label = "only the last flag can take args"] Span), #[error("Missing required positional argument.")] - #[diagnostic(code(nu::parser::missing_positional), help("Usage: {2}"))] + #[diagnostic( + code(nu::parser::missing_positional), + help("Usage: {2}. Use `--help` for more information.") + )] MissingPositional(String, #[label("missing {0}")] Span, String), #[error("Missing argument to `{1}`.")]