On Wed, Apr 25, 2018 at 12:30 PM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote: > The current generate-cmds.sh generates just enough to print "git help" > output. That is, it only extracts help text for common commands. > > The script is now updated to extract help text for all commands and > keep command classification a new file, command-list.h. This will be > useful later: > [...] > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh > @@ -12,14 +34,51 @@ get_synopsis () { > +define_categories() { > + echo > + echo "/* Command categories */" > + bit=0 > + category_list "$1" | > + while read cat > + do > + echo "#define CAT_$cat (1UL << $bit)" > + bit=$(($bit+1)) > + done > + test "$bit" -gt 32 && die "Urgh.. too many categories?" Should this be '-ge' rather than '-gt'? > +}