summaryrefslogtreecommitdiff
path: root/doc/mkrbash
diff options
context:
space:
mode:
Diffstat (limited to 'doc/mkrbash')
-rwxr-xr-xdoc/mkrbash19
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/mkrbash b/doc/mkrbash
index 4304e63f..b76b7535 100755
--- a/doc/mkrbash
+++ b/doc/mkrbash
@@ -4,18 +4,35 @@
# of the texinfo manual
#
+# defaults for doing this in the source tree
+SRCDIR=.
+TOPDIR=..
+
NODE="The Restricted Shell"
TEXI=bashref.texi
TMPINFO=temp.info
TMPOUT=RBASH.tmp
+prog=${0##*/}
+USAGE="usage: $prog [-s srcdir] [-t topdir] [output-file]"
+while getopts s:t: opt
+do
+ case "$opt" in
+ s) SRCDIR=$OPTARG TEXI=${OPTARG}/bashref.texi ;;
+ t) TOPDIR=$OPTARG ;;
+ *) echo "$USAGE" >&2 ; exit 2 ;;
+ esac
+done
+shift $(( $OPTIND - 1 ))
+
OUT=${1:-RBASH}
trap 'rm -f $TMPOUT $TMPINFO $OUT; trap '' 0; exit 1' 1 2 3 6 15
trap 'rm -f $TMPOUT $TMPINFO' 0
# create an info file without paragraph indentation
-makeinfo --no-split -I../lib/readline/doc --paragraph-indent 0 -o $TMPINFO $TEXI
+RLDIR=${TOPDIR}/lib/readline/doc
+makeinfo --no-split -I${RLDIR} --paragraph-indent 0 -o $TMPINFO $TEXI
# write out the text from the `The Restricted Shell' node to $TMPOUT
info --file $TMPINFO --node "$NODE" --subnodes --output $TMPOUT