22 Install HTML info document.
24 Usage: $name [OPTIONS]... [DOCUMENT-DIR]...
27 -a, --all assume all subdirectories of index to be DOCUMENT-DIRs
28 -d, --dir=DIR set index directory to DIR (default=.)
29 -D, --debug print debugging info
30 -h, --help show this help text
31 -v, --version show version
38 $debug_echo "cleaning ($?)..."
44 # Find command line options and switches
47 # "x:" x takes argument
51 # ugh, "\-" is a hack to support long options
52 # must be in double quotes for bash-2.0
54 while getopts "\-:$options" O
56 $debug_echo "O: \`$O'"
57 $debug_echo "arg: \`$OPTARG'"
63 [ "$debug_echo" = "echo" ] && set -x
84 [ "$debug_echo" = "echo" ] && set -x
92 index_dir="`expr \"$OPTARG\" ':' '[^=]*=\(.*\)'`"
99 echo "$0: invalid option -- \"$OPTARG\""
106 shift `expr $OPTIND - 1`
111 if [ -z "$all" -a -z "$1" ]; then
113 echo "$name: No HTML documents given"
117 if [ -n "$all" -a -n "$1" ]; then
118 echo "$name: --all specified, ignoring DIRECTORY-DIRs"
121 if [ -n "$all" ]; then
122 document_dirs=`/bin/ls -d1 $index_dir`
127 index_file=$index_dir/index.html
129 echo -n "$name: Writing index: $index_file..."
132 cat >> $index_file <<EOF
134 <title>Info documentation index</title>
136 <h1>Info documentation index</h1>
138 This is the directory file \`index.html' a.k.a. \`DIR', which contains the
139 topmost node of the HTML Info hierarchy.
145 for i in $document_dirs; do
147 <li> <a href="$i/index.html">$i</a> (<a href="$i.html">$i as one big page</a>)</li>
152 cat >> $index_file <<EOF