8 main (int argc
, char **argv
)
20 while ((c
= getopt (argc
, argv
, "abc:")) != -1)
34 fprintf (stderr
, "Option -%c requires an argument.\n", optopt
);
35 else if (isprint (optopt
))
36 fprintf (stderr
, "Unknown option `-%c'.\n", optopt
);
39 "Unknown option character `\\x%x'.\n",
48 printf ("aflag = %d, bflag = %d, cvalue = %s\n",
49 aflag
, bflag
, cvalue
);
51 for (index
= optind
; index
< argc
; index
++)
52 printf ("Non-option argument %s\n", argv
[index
]);