diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-27 22:59:31 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-27 23:05:01 -0700 |
commit | fdd80b98e9419dc0eaaa367f919252420d4f7676 (patch) | |
tree | 4d428f1a8111f43455a5ee272df73dd13dc25202 /build-aux/lint-h | |
parent | 5b725e3888442777bdb5c0d656238a13414990b3 (diff) |
make lint: Have the output be a little prettier
Diffstat (limited to 'build-aux/lint-h')
-rwxr-xr-x | build-aux/lint-h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/build-aux/lint-h b/build-aux/lint-h index 965d7d8..26ac13d 100755 --- a/build-aux/lint-h +++ b/build-aux/lint-h @@ -4,6 +4,14 @@ # Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> # SPDX-License-Identifier: AGPL-3.0-or-later +RED=$(tput setaf 1) +RESET=$(tput sgr0) + +err() { + printf "${RED}%s${RESET}: %s\n" "$1" "$2" >&2 + r=1 +} + r=0 for filename in "$@"; do dscname=$(./build-aux/get-dscname "$filename") @@ -13,7 +21,7 @@ for filename in "$@"; do if ! { grep -Fxq "#ifndef ${guard}" "$filename" && grep -Fxq "#define ${guard}" "$filename" && grep -Fxq "#endif /* ${guard} */" "$filename"; }; then - echo "$filename does not have ${guard} guard"; r=1 + err "$filename" "does not have ${guard} guard" fi done exit $r |