aboutsummaryrefslogtreecommitdiff
path: root/generate-cmdlist.sh
blob: 6ee85d5a5316d21c930bb31ba8fac4c651253ac0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

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

struct cmdname_help common_cmds[] = {"

sort <<\EOF |
add
apply
bisect
branch
checkout
cherry-pick
clone
commit
diff
fetch
grep
init-db
log
merge
mv
prune
pull
push
rebase
reset
revert
rm
show
show-branch
status
tag
verify-tag
whatchanged
EOF
while read cmd
do
    sed -n "/NAME/,/git-$cmd/H;
	    \$ {x; s/.*git-$cmd - \\(.*\\)/  {\"$cmd\", \"\1\"},/; p}" \
	"Documentation/git-$cmd.txt"
done
echo "};"