]>
git.ipfire.org Git - thirdparty/git.git/blob - generate-cmdlist.sh
30 s/.*'"$1"' - \(.*\)/N_("\1")/
32 }' "Documentation/$1.txt"
35 define_categories
() {
37 echo "/* Command categories */"
42 echo "#define CAT_$cat (1UL << $bit)"
45 test "$bit" -gt 32 && die
"Urgh.. too many categories?"
48 print_command_list
() {
49 echo "static struct cmdname_help command_list[] = {"
54 printf " { \"$cmd\", $(get_synopsis $cmd), 0"
55 for cat in $
(echo "$rest" | get_categories
)
64 echo "/* Automatically generated by generate-cmdlist.sh */
73 define_categories
"$1"
75 print_command_list
"$1"
79 echo "static const char *common_cmd_groups[] = {"
83 trap "rm -f '$grps' '$match'" 0 1 2 3 15
86 1,/^### common groups/b
90 h;s/^[^ ][^ ]*[ ][ ]*\(.*\)/ N_("\1"),/p
91 g;s/^\([^ ][^ ]*\)[ ].*/\1/w '$grps'
99 echo "^git-..*[ ]$grp"
100 substnum
="$substnum${substnum:+;}s/[ ]$grp/$n/"
102 done <"$grps" >"$match"
104 printf 'static struct cmdname_help common_cmds[] = {\n'
105 grep -f "$match" "$1" |
110 tag
=$
(echo "$tags" |
sed "$substnum; s/[^0-9]//g")
111 echo " {\"$cmd\", $(get_synopsis git-$cmd), $tag},"