GetoptStdc extension

<getopt.h> standard and GNU extensions for stdc.

on

Properties

optarg String?

Available on Stdc, provided by the GetoptStdc extension

For communication from getopt to the caller. When getopt finds an option that takes an argument, the argument value is stored here.
getter/setter pair
opterr int

Available on Stdc, provided by the GetoptStdc extension

If opterr is set to 0, getopt does not print an error message.
getter/setter pair
optind int

Available on Stdc, provided by the GetoptStdc extension

Index of the next element to be processed in argv. The system initializes this value to 1.
getter/setter pair
optopt int

Available on Stdc, provided by the GetoptStdc extension

When getopt encounters an unknown option character or an option with a missing required argument, it stores that option character in this variable.
getter/setter pair

Methods

getopt(int argc, List<String> argv, String optstring) int

Available on Stdc, provided by the GetoptStdc extension

Parses command-line arguments.
getopt_long(int argc, List<String> argv, String optstring, List<Option> longopts, [List<int>? longindex]) int

Available on Stdc, provided by the GetoptStdc extension

Parses long options in addition to short options.
optreset() → void

Available on Stdc, provided by the GetoptStdc extension

Resets the internal getopt state.