man 3 getopt
int getopt(int argc, char *argv[], const char *optstring);
#include <unistd.h>
extern char *optarg; extern int optind, opterr, optopt;
optarg
is for argument options
optind
is the index into argv for the current action.
int optopt
.
int opterr
int getopt_long(int argc, char *argv[],
const char *optstring,
const struct option *longopts, int *longindex);