2006-05-04 17:08:33 +05:30
|
|
|
#!/usr/bin/awk -f
|
|
|
|
# AWK script to check for missing help entries for config options
|
|
|
|
#
|
2008-09-25 17:43:34 +05:30
|
|
|
# Copyright (C) 2006 Bernhard Reutner-Fischer
|
2006-09-17 21:58:10 +05:30
|
|
|
#
|
2006-05-04 17:08:33 +05:30
|
|
|
# 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;
|
|
|
|
}
|
|
|
|
}
|
2006-11-22 15:09:48 +05:30
|
|
|
/^[ \t]*help[ \t]*$/ {
|
2006-05-04 17:08:33 +05:30
|
|
|
help[pos] = 1;
|
|
|
|
}
|
2006-11-22 15:09:48 +05:30
|
|
|
/^[ \t]*bool[ \t]*$/ {
|
2006-05-05 19:35:21 +05:30
|
|
|
help[pos] = 1; # ignore options which are not selectable
|
|
|
|
}
|
2006-05-04 17:08:33 +05:30
|
|
|
BEGIN {
|
|
|
|
pos = -1;
|
|
|
|
is_choice = 0;
|
|
|
|
}
|
|
|
|
END {
|
2006-11-22 15:09:48 +05:30
|
|
|
for (i = 0; i <= pos; i++) {
|
|
|
|
# printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]);
|
2006-05-04 17:08:33 +05:30
|
|
|
if (help[i] == 0) {
|
|
|
|
printf("%s: No helptext for '%s'\n", file[i], conf[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|