git/generate-cmdlist.sh

46 lines
500 B
Bash
Raw Normal View History

#!/bin/sh
echo "/* Automatically generated by $0 */
struct cmdname_help
{
char name[16];
char help[80];
};
static struct cmdname_help common_cmds[] = {"
sort <<\EOF |
add
bisect
branch
checkout
clone
commit
diff
fetch
grep
init
log
merge
mv
pull
push
rebase
reset
rm
show
status
tag
EOF
while read cmd
do
sed -n '
/NAME/,/git-'"$cmd"'/H
${
x
s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
p
}' "Documentation/git-$cmd.txt"
done
echo "};"