|
Last change
on this file was
10646,
checked in by westram, 12 years ago
|
- remove write permission for generated help-files
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
-
Property svn:keywords set to
Author Date Id Revision
|
|
File size:
709 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 | SED=${ARBHOME}/SH/arb_sed |
|---|
| 14 | |
|---|
| 15 | if [ \! -f $HEADER ]; then |
|---|
| 16 | echo "Header '$HEADER' not found" |
|---|
| 17 | exit 1 |
|---|
| 18 | fi |
|---|
| 19 | if [ \! -f $INPUTTEXT ]; then |
|---|
| 20 | echo "Input '$INPUTTEXT' not found" |
|---|
| 21 | exit 1 |
|---|
| 22 | fi |
|---|
| 23 | |
|---|
| 24 | write_help() { |
|---|
| 25 | echo "$TITLE" |
|---|
| 26 | echo "" |
|---|
| 27 | echo "# Do not edit!!! Generated from ../$INPUTTEXT" |
|---|
| 28 | echo "" |
|---|
| 29 | cat $HEADER |
|---|
| 30 | $SED -e 's/^/ /' < $INPUTTEXT |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | test -f $OUTPUTFILE && chmod u+w $OUTPUTFILE |
|---|
| 34 | write_help > $OUTPUTFILE |
|---|
| 35 | test -f $OUTPUTFILE && chmod a-w $OUTPUTFILE |
|---|
Note: See
TracBrowser
for help on using the repository browser.