FIX issue #19 where multiple widget values led to bad replacements in the command
[qgit4/redivivus.git] / src / helpgen.sh
blob7436231c18843b303a9faccb48a7a4888e735250
1 #!/bin/sh
3 # Generate help.h from README.adoc
5 set -e
7 infile="$1"
8 outfile="$2"
9 tmpfile1="$2.t1"
10 tmpfile2="$2.t2"
12 asciidoc --attribute 'newline=\n' --backend=html4 --no-header-footer \
13 --out-file="$tmpfile1" "$infile"
15 sed -n -e 's/"/\\"/g' -e '/Command line arguments/,$s/^.*$/"&\\n"/p' \
16 "$tmpfile1" >"$tmpfile2"
18 cat >"$outfile" <<EOF
19 /* Help content is generated automatically from README.adoc by helpgen script */
21 static const char* helpInfo =
22 "<qt>\n"
23 "<center><h1>QGit Handbook</h1></center>\n"
24 `cat "$tmpfile2"`
25 "</qt>\n";
26 EOF
28 rm -f "$tmpfile1" "$tmpfile2"