2 * This material, written by Henry Spencer, was released by him
3 * into the public domain and is thus not subject to any copyright.
6 #define _XOPEN_SOURCE 700
14 main(int argc
, char *argv
[])
20 fprintf(stderr
, "%s: no arguments given\n", argv
[0]);
24 optind
= 2; /* Past the program name and the option letters. */
25 while ((c
= getopt(argc
, argv
, argv
[1])) != -1) {
28 status
= 1; /* getopt routine gave message */
32 printf(" -%c %s", c
, optarg
);
40 for (; optind
< argc
; optind
++)
41 printf(" %s", argv
[optind
]);