From a4bcba68402e421266dfcf01a1b3a18e0ad441ee Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 13 Oct 2022 12:10:13 -0500 Subject: [PATCH] fix(error): Consistently indent suggestions --- src/error/format.rs | 6 ++++-- tests/builder/subcommands.rs | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/error/format.rs b/src/error/format.rs index 018a02c382e..4442a8e5386 100644 --- a/src/error/format.rs +++ b/src/error/format.rs @@ -194,9 +194,11 @@ fn write_dynamic_context(error: &crate::error::Error, styled: &mut StyledStr) -> let suggestion = error.get(ContextKind::SuggestedCommand); if let Some(ContextValue::String(suggestion)) = suggestion { + styled.none("\n\n"); + styled.none(TAB); styled.none( - "\n\nIf you believe you received this message in error, try re-running with '", - ); + "If you believe you received this message in error, try re-running with '", + ); styled.good(suggestion); styled.none("'"); } diff --git a/tests/builder/subcommands.rs b/tests/builder/subcommands.rs index 57ed714ffce..8437aef01af 100644 --- a/tests/builder/subcommands.rs +++ b/tests/builder/subcommands.rs @@ -102,7 +102,7 @@ error: The subcommand 'subcm' wasn't recognized Did you mean 'subcmd'? -If you believe you received this message in error, try re-running with 'dym -- subcm' + If you believe you received this message in error, try re-running with 'dym -- subcm' Usage: dym [COMMAND] @@ -123,7 +123,7 @@ error: The subcommand 'te' wasn't recognized Did you mean 'test', 'temp'? -If you believe you received this message in error, try re-running with 'dym -- te' + If you believe you received this message in error, try re-running with 'dym -- te' Usage: dym [COMMAND] @@ -524,7 +524,7 @@ error: The subcommand 'baz' wasn't recognized Did you mean 'bar'? -If you believe you received this message in error, try re-running with ' -- baz' + If you believe you received this message in error, try re-running with ' -- baz' Usage: