diff options
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 |