getopt

Name

getopt -- parse command line options

Synopsis

int getopt(int argc, char * const argv[], const char *opstring);

extern char *optarg;
extern int optind, opterr, optopt;

Description

getopt parses command line arguments. GNU and POSIX specifications for this function vary in the following areas. LSB systems shall implement the GNU behaviors described below.

Option Characteristics

GNU specifies that:

POSIX specifies that:

Extensions

GNU specifies that:

POSIX specifies that:

Return Values

GNU specifies the following getopt return values:

POSIX specifies the following getopt return values:

Environment Variables

GNU specifies that: