summaryrefslogtreecommitdiff
path: root/generate-cmdlist.sh
diff options
context:
space:
mode:
Diffstat (limited to 'generate-cmdlist.sh')
-rwxr-xr-xgenerate-cmdlist.sh49
1 files changed, 12 insertions, 37 deletions
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index 6ee85d5a53..1093ef4ad6 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -1,48 +1,23 @@
#!/bin/sh
echo "/* Automatically generated by $0 */
-struct cmdname_help
-{
+struct cmdname_help {
char name[16];
- char help[64];
+ char help[80];
};
-struct cmdname_help common_cmds[] = {"
+static 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
+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"
+ sed -n '
+ /^NAME/,/git-'"$cmd"'/H
+ ${
+ x
+ s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
+ p
+ }' "Documentation/git-$cmd.txt"
done
echo "};"