#! @SH@

# file: $ISIP_IFC/util/misc/shell_functions/isip_help_function_0.sh
# version: $Id: isip_function_help_0.sh 9611 2004-07-03 18:06:03Z picone $
#
# a simple, standard method of displaying a help message
#

# important definitions
#
PROGRAM_NAME="isip_help_function_0";
DEFAULT_ISIP_HELP_OPTION="-help";
DEFAULT_ISIP_HELP_COMMAND="more";

ISIP_ERROR="1";
ISIP_NOERROR="0";

# check for the existence of the appropriate environment variables
#
ISIP_HELP_OPTION=${ISIP_HELP_OPTION:-"$DEFAULT_ISIP_HELP_OPTION"};
ISIP_HELP_COMMAND=${ISIP_HELP_COMMAND:-"$DEFAULT_ISIP_HELP_COMMAND"};

if (test ! -f "$ISIP_HELP_FILE") then
    echo "<$PROGRAM_NAME> an appropriate help file does not exist ($ISIP_HELP_FILE)";
    exit $ISIP_ERROR;
fi

# define a help function
#
display_help_message_0 () {
    $ISIP_HELP_COMMAND $ISIP_HELP_FILE;
    exit $ISIP_ERROR;
}

# check for an argument requesting help - display message and exit
#
for arg do
    if (test "$arg" = "$ISIP_HELP_OPTION") then
	display_help_message_0;
    fi
done

# end of file
exit $ISIP_NOERROR;
