From ed6ecdedb8fc3d055ef2a6858a8370982cb3712d Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 26 Oct 2023 09:13:44 -0400 Subject: [PATCH] tools/format-cpp: use a group of `echo` lines with a single `>& 2` Signed-off-by: Philippe Proulx Change-Id: I4202fa48c0fe6909aeb3b1ea34870e920908917f Reviewed-on: https://review.lttng.org/c/babeltrace/+/11144 Reviewed-by: Simon Marchi --- tools/format-cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/format-cpp b/tools/format-cpp index 29a0bf7e..dfc4bbd5 100755 --- a/tools/format-cpp +++ b/tools/format-cpp @@ -17,11 +17,14 @@ format_cpp() { fi if [[ "$version" != *"clang-format version $expected_formatter_major_version"* ]]; then - echo "Expecting clang-format $expected_formatter_major_version." >&2 - echo >&2 - echo Got: >&2 - echo >&2 - echo "$version" >&2 + { + echo "Expecting clang-format $expected_formatter_major_version." + echo + echo Got: + echo + echo "$version" + } >& 2 + return 1 fi -- 2.34.1