Bernhard Reutner-Fischer | 3916b2a | 2006-05-04 11:38:33 +0000 | [diff] [blame] | 1 | #!/usr/bin/awk -f |
| 2 | # AWK script to check for missing help entries for config options |
| 3 | # |
Bernhard Reutner-Fischer | 6c4dade | 2008-09-25 12:13:34 +0000 | [diff] [blame] | 4 | # Copyright (C) 2006 Bernhard Reutner-Fischer |
Denis Vlasenko | 9213a9e | 2006-09-17 16:28:10 +0000 | [diff] [blame] | 5 | # |
Bernhard Reutner-Fischer | 3916b2a | 2006-05-04 11:38:33 +0000 | [diff] [blame] | 6 | # This file is distributed under the terms and conditions of the |
| 7 | # MIT/X public licenses. See http://opensource.org/licenses/mit-license.html |
| 8 | # and notice http://www.gnu.org/licenses/license-list.html#X11License |
| 9 | |
| 10 | |
| 11 | /^choice/ { is_choice = 1; } |
| 12 | /^endchoice/ { is_choice = 0; } |
| 13 | /^config/ { |
| 14 | pos++; |
| 15 | conf[pos] = $2; |
| 16 | file[pos] = FILENAME; |
| 17 | if (is_choice) { |
| 18 | help[pos] = 1; # do not warn about 'choice' config entries. |
| 19 | } else { |
| 20 | help[pos] = 0; |
| 21 | } |
| 22 | } |
Bernhard Reutner-Fischer | d6bbf99 | 2006-11-22 09:39:48 +0000 | [diff] [blame] | 23 | /^[ \t]*help[ \t]*$/ { |
Bernhard Reutner-Fischer | 3916b2a | 2006-05-04 11:38:33 +0000 | [diff] [blame] | 24 | help[pos] = 1; |
| 25 | } |
Bernhard Reutner-Fischer | d6bbf99 | 2006-11-22 09:39:48 +0000 | [diff] [blame] | 26 | /^[ \t]*bool[ \t]*$/ { |
Bernhard Reutner-Fischer | 0e413e5 | 2006-05-05 14:05:21 +0000 | [diff] [blame] | 27 | help[pos] = 1; # ignore options which are not selectable |
| 28 | } |
Bernhard Reutner-Fischer | 3916b2a | 2006-05-04 11:38:33 +0000 | [diff] [blame] | 29 | BEGIN { |
| 30 | pos = -1; |
| 31 | is_choice = 0; |
| 32 | } |
| 33 | END { |
Bernhard Reutner-Fischer | d6bbf99 | 2006-11-22 09:39:48 +0000 | [diff] [blame] | 34 | for (i = 0; i <= pos; i++) { |
Denys Vlasenko | 3581c62 | 2010-01-25 13:39:24 +0100 | [diff] [blame] | 35 | # printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]); |
Bernhard Reutner-Fischer | 3916b2a | 2006-05-04 11:38:33 +0000 | [diff] [blame] | 36 | if (help[i] == 0) { |
| 37 | printf("%s: No helptext for '%s'\n", file[i], conf[i]); |
| 38 | } |
| 39 | } |
| 40 | } |