Source
#-----------------------------------------------------------------------------
# dox: Select and view documents online
#-----------------------------------------------------------------------------
#
# Copyright (C) 1993,1994,1995
# Associated Universities, Inc. Washington DC, USA.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Correspondence concerning AIPS++ should be addressed as follows:
# Internet email: aips2-request@nrao.edu.
# Postal address: AIPS++ Project Office
# National Radio Astronomy Observatory
# 520 Edgemont Road
# Charlottesville, VA 22903-2475 USA
#
#-----------------------------------------------------------------------------
# Usage: dox [-d <directory> | --directory==<directory>]
# [-D <default> | --default==<default>]
# [-r | --restrict-search]
# [<document>]
#-----------------------------------------------------------------------------
# dox provides a convenient user interface for selecting and viewing the
# documents stored in a specified directory and its subdirectories,
# $AIPSROOT/docs by default.
#
# dox recognizes DVI, HTML, PostScript, and ASCII files, and also many
# standard unix file types (via their file suffix). It also handles
# compressed PostScript and text files with .gz, .z, and .Z suffix extensions.
#
# If no document is specified on the command line then dox will produce a list
# of all available documents and ask the user to pick one. Full minimum-
# match is applied to the user's response, including minimum-match on the
# subdirectory name.
#
# If a document is specified on the command line then full minimum-match is
# applied to it (including matching on subdirectories). Likewise for any
# default specified.
#
# Options:
# -d The documentation directory (default is $AIPSROOT/docs).
# -D Default document when querying the user interactively.
# -r Restrict the search of the documentation directory and all
# subdirectories to *.dvi, *.htm, *.htm, *.ps*, *.text*, and *.txt*
# files when preparing the document list. The default is to list
# everything.
#
# Status return values
# 0: success
# 1: initialization error
# 2: error getting document name
# 3: error starting previewer
#
# Notes:
# 1) Whitespace is allowed between short-form options and their arguments.
#
# Original: 1993/08/09 by Mark Calabretta, ATNF
# $Id$
#=============================================================================
# Fundamentals.
if [ ! "$CASAPATH" ]
then
echo "dox: CASAPATH is not defined, abort!"
exit 1
fi
AIPSROOT=`echo $CASAPATH | awk '{ print $1 }'`
# Parse arguments.
if [ "$DOXPATH" != "" ]
then
DOXPATH=`echo $DOXPATH | sed -e 's/::*/ /'`
else
DOXPATH=$AIPSROOT/docs
fi
DEFAULTMM=reference/Introaips.ps