source: tags/svn.1.5.4/GDEHELP/genhelp.sh

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
3if [ -z "$4" ] ; then
4    echo "Usage: genhelp.sh outputfile title header inputtext"
5    echo "       Generates help pre-source 'outputfile' from 'inputtext'"
6    exit 1
7fi
8
9OUTPUTFILE=$1
10TITLE=$2
11HEADER=$3
12INPUTTEXT=$4
13
14if [ \! -f $HEADER ]; then
15    echo "Header '$HEADER' not found"
16    exit 1
17fi
18if [ \! -f $INPUTTEXT ]; then
19    echo "Input '$INPUTTEXT' not found"
20    exit 1
21fi
22
23write_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
32write_help > $OUTPUTFILE
Note: See TracBrowser for help on using the repository browser.