about summary refs log tree commit diff
path: root/xlint
diff options
context:
space:
mode:
Diffstat (limited to 'xlint')
-rwxr-xr-xxlint7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlint b/xlint
index 997d99d..0b1ea22 100755
--- a/xlint
+++ b/xlint
@@ -37,9 +37,12 @@ exists_once() {
 	for var in pkgname version revision short_desc maintainer license \
 		   homepage; do
 		case "$(grep -c "^${var}=" "$template")" in
-			0) echo "$argument: '$var' missing!";;
+			0) echo "$argument:1: '$var' missing!";;
 			1) ;;
-			*) echo "$argument: '$var' defined more than once";;
+			*)
+				lines="$(grep -n "^${var}=" "$template" | awk -F: 'NR>1 { printf ", " } { printf "%s", $1 }')"
+				echo "$argument:${lines##*, }: '$var' defined more than once: previously on line(s) ${lines%,*}"
+				;;
 		esac
 	done
 }