https://github.com/git/git
Raw File
Tip revision: e5056c05ecd2bdaceaa95e12e9e94b1584ec59c8 authored by Junio C Hamano on 03 April 2012, 16:25:49 UTC
Git 1.7.10-rc4
Tip revision: e5056c0
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