summaryrefslogtreecommitdiff
path: root/scripts/checkhelp.awk
blob: 1a7e0ea8e56d3c91a95ba00325e305c8ee2ea9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/awk -f
# AWK script to check for missing help entries for config options
#
# Copyright (C) 2006 Bernhard Fischer
# 
# This file is distributed under the terms and conditions of the
# MIT/X public licenses. See http://opensource.org/licenses/mit-license.html
# and notice http://www.gnu.org/licenses/license-list.html#X11License


/^choice/ { is_choice = 1; }
/^endchoice/ { is_choice = 0; }
/^config/ {
	pos++;
	conf[pos] = $2;
	file[pos] = FILENAME;
	if (is_choice) {
		help[pos] = 1; # do not warn about 'choice' config entries.
	} else {
		help[pos] = 0;
	}
}
/^[[:space:]]*help[[:space:]]*$/ {
	help[pos] = 1;
}
BEGIN {
	pos = -1;
	is_choice = 0;
}
END {
	for (i = 0; i < pos; i++) {
#	printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]);
		if (help[i] == 0) {
			printf("%s: No helptext for '%s'\n", file[i], conf[i]);
		}
	}
}