AG_GETOPT(3)

NAME
AG_Getopt - agar getopt() implementation

SYNOPSIS

    #include <agar/core.h>

DESCRIPTION
The AG_Getopt interface parses command-line arguments.

INTERFACE
int AG_Getopt(int argc, char * const argv[], const char *optstring, char **optarg_out, int *optind_out)

The AG_Getopt() function is a wrapper to getopt(3), on platforms where it is supported. The optarg value is returned into optarg_out, and optind is returned into optind_out.

If successful, AG_Getopt() returns the next option character. On platforms where command-line arguments are not supported, AG_Getopt() always returns -1.

SEE ALSO
AG_Intro(3)

HISTORY
The AG_Getopt interface first appeared in Agar 1.4