5.1 Types, Constants and variables :

Constants

No_Argument=0 : Specifies that a long option does not take an argument.
Required_Argument=1 : Specifies that a long option needs an argument.
Optional_Argument=2 : Specifies that a long option optionally takes an argument.
EndOfOptions=#255 : Returned by getopt, getlongopts to indicate that there are no more options.

Types

 TOption = record
   Name    : String;
   Has_arg : Integer;
   Flag    : PChar;
   Value   : Char;
   end;
 POption = ^TOption;
The option type is used to communicate the long options to GetLongOpts. The Name field is the name of the option. Has_arg specifies if the option wants an argument, Flag is a pointer to a char, which is set to Value, if it is non-nil. POption is a pointer to a Option record. It is used as an argument to the GetLongOpts function.

Variables

OptArg:String  Is set to the argument of an option, if the option needs one.
Optind:Longint  Is the index of the current paramstr(). When all options have been processed, optind is the index of the first non-option parameter. This is a read-only variable. Note that it can become equal to paramcount+1
OptErr:Boolean  Indicates whether getopt() prints error messages.
OptOpt:Char  In case of an error, contains the character causing the error.