#!/bin/bash # file: $NEDC_NFC/util/shell/isip_help/isip_help.sh # # revision history: # # 20210216 (JP): first version integrated into NEDC # # 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;