Skip to content

Commit

Permalink
Merge pull request #4382 from epage/consistent
Browse files Browse the repository at this point in the history
fix(error): Consistently indent suggestions
  • Loading branch information
epage authored Oct 13, 2022
2 parents de9b92c + a4bcba6 commit bae951b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/error/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("'");
}
Expand Down
6 changes: 3 additions & 3 deletions tests/builder/subcommands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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: <COMMAND>
Expand Down

0 comments on commit bae951b

Please sign in to comment.