#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
Go to the source code of this file.
◆ BADARG
◆ BADCH
◆ EMSG
◆ getopt()
Definition at line 59 of file getopt.c.
60 static char *place =
EMSG;
65 if (
optind >= nargc || *(place = nargv[
optind]) !=
'-') {
69 if (place[1] && *++place ==
'-') {
75 if ((
optopt = (
int)*place++) == (
int)
':' || !(oli = (
char *)strchr(ostr,
optopt))) {
84 if (
opterr && *ostr !=
':')
85 (void)fprintf(stderr,
"illegal option -- %c\n",
optopt);
96 else if (nargc <= ++
optind) {
101 (void)fprintf(stderr,
"option requires an argument -- %c\n",
optopt);
References BADARG, BADCH, EMSG, NULL, optarg, opterr, optind, optopt, and optreset.
◆ optarg
◆ opterr
◆ optind
◆ optopt
◆ optreset