13 # Ignore comments and allow empty lines
17 case "$exclude_programs" in
36 define_categories
() {
38 echo "/* Command categories */"
43 echo "#define CAT_$cat (1UL << $bit)"
46 test "$bit" -gt 32 && die
"Urgh.. too many categories?"
49 define_category_names
() {
51 echo "/* Category names */"
52 echo "static const char *category_names[] = {"
57 echo " \"$cat\", /* (1UL << $bit) */"
64 print_command_list
() {
65 echo "static struct cmdname_help command_list[] = {"
75 synopsis
=${line#$cmd - }
79 done <"Documentation/$cmd.txt"
81 printf '\t{ "%s", N_("%s"), 0' "$cmd" "$synopsis"
82 printf " | CAT_%s" $rest
89 while test "--exclude-program" = "$1"
92 exclude_programs
="$exclude_programs$1:"
96 commands
="$(command_list "$1")"
97 categories
="$(category_list "$commands")"
99 echo "/* Automatically generated by generate-cmdlist.sh */
100 struct cmdname_help {
106 define_categories
"$categories"
108 define_category_names
"$categories"
110 print_command_list
"$commands"