topgit: version 0.19.13
[topgit/pro.git] / create-help.sh
blob04000b0c6e1eeab007cbd8e9d4c81b73106e5eb2
1 #!/bin/sh
3 # Create the tg-foo.txt files which contain help for the tg-foo command.
5 if [ $# -ne 1 ] ; then
6 echo "Usage: $0 <tgcommand>" 1>&2
7 exit 1
8 fi
10 < README_DOCS.rst awk '
11 BEGIN { incommand = 0; }
12 /^tg '"$1"'$/ { incommand = 1; next; }
13 /^~/ { next; } # Ignore the title underlines.
14 /^[^\t]/ { incommand = 0; next; }
15 { if (incommand) { print $0; } }
16 ' | perl ./polish-help-txt.pl > tg-"$1".txt