https://github.com/git/git
Raw File
Tip revision: 828ea97de486c1693d6e4f2c7347acb50235a85d authored by Junio C Hamano on 27 January 2012, 19:31:02 UTC
Git 1.7.9
Tip revision: 828ea97
generate-cmdlist.sh
#!/bin/sh

echo "/* Automatically generated by $0 */
struct cmdname_help {
    char name[16];
    char help[80];
};

static struct cmdname_help common_cmds[] = {"

sed -n -e 's/^git-\([^ 	]*\)[ 	].* common.*/\1/p' command-list.txt |
sort |
while read cmd
do
     sed -n '
     /^NAME/,/git-'"$cmd"'/H
     ${
	    x
	    s/.*git-'"$cmd"' - \(.*\)/  {"'"$cmd"'", "\1"},/
	    p
     }' "Documentation/git-$cmd.txt"
done
echo "};"
back to top