[go: up one dir, main page]

File: helpgen.sh

package info (click to toggle)
qgit 2.3-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,152 kB
  • ctags: 1,477
  • sloc: cpp: 11,857; makefile: 51; sh: 39
file content (28 lines) | stat: -rwxr-xr-x 559 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

# Generate help.h from README

set -e

infile="$1"
outfile="$2"
tmpfile1="$2.t1"
tmpfile2="$2.t2"

asciidoc --attribute 'newline=\n' --backend=html4 --no-header-footer \
	--out-file="$tmpfile1" "$infile"

sed -n -e 's/"/\\"/g' -e '/Command line arguments/,$s/^.*$/"&\\n"/p' \
	"$tmpfile1" >"$tmpfile2"

cat >"$outfile" <<EOF
/* Help content is generated automatically from README by helpgen script */

static const char* helpInfo =
"<qt>\n"
"<center><h1>QGit Handbook</h1></center>\n"
`cat "$tmpfile2"`
"<qt>\n";
EOF

rm -f "$tmpfile1" "$tmpfile2"