Last change
on this file was
6134,
checked in by westram, 16 years ago
|
- add source information to generated help files
- forward comments w/o prepending 'SECTION'
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
592 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | if [ -z "$4" ] ; then |
---|
4 | echo "Usage: genhelp.sh outputfile title header inputtext" |
---|
5 | echo " Generates help pre-source 'outputfile' from 'inputtext'" |
---|
6 | exit 1 |
---|
7 | fi |
---|
8 | |
---|
9 | OUTPUTFILE=$1 |
---|
10 | TITLE=$2 |
---|
11 | HEADER=$3 |
---|
12 | INPUTTEXT=$4 |
---|
13 | |
---|
14 | if [ \! -f $HEADER ]; then |
---|
15 | echo "Header '$HEADER' not found" |
---|
16 | exit 1 |
---|
17 | fi |
---|
18 | if [ \! -f $INPUTTEXT ]; then |
---|
19 | echo "Input '$INPUTTEXT' not found" |
---|
20 | exit 1 |
---|
21 | fi |
---|
22 | |
---|
23 | write_help() { |
---|
24 | echo "$TITLE" |
---|
25 | echo "" |
---|
26 | echo "# Do not edit!!! Generated from ../$INPUTTEXT" |
---|
27 | echo "" |
---|
28 | cat $HEADER |
---|
29 | sed -e 's/^/ /' < $INPUTTEXT |
---|
30 | } |
---|
31 | |
---|
32 | write_help > $OUTPUTFILE |
---|
Note: See
TracBrowser
for help on using the repository browser.