displayUsage()

Display the usage and command line option description to the standard output stream.

Syntax

Getopt.displayUsage(
   more_args STRING
   )
  1. more_args is a character string to be displayed at the end of the "Usage..." line.

Usage

This is a method for the Getopt type, used to display the description of the command line options of the current program.

The more_args passed as parameter to the displayUsage() method will be shown in the first line, after the option list:
Usage: program-name [options] more_args

Before using the displayUsage() method, a variable of the type Getopt must be defined and initialized with the initDefault() or initialize() method.

The displayUsage() method is typically called when an invalid command line option is detected (when invalidOptionSeen() returns TRUE) or when the --help/-h option is used.

Example

IMPORT FGL getopt

MAIN
    DEFINE g getopt.Getopt
    ...
    IF g.opt_char=="h" THEN
        CALL g.displayUsage(NULL)
        EXIT PROGRAM 0
    END IF
    ...
END MAIN