1 /* $NetBSD: getopt.c,v 1.7 2006/07/09 21:38:47 wiz Exp $ */
4 * This material, written by Henry Spencer, was released by him
5 * into the public domain and is thus not subject to any copyright.
10 __RCSID("$NetBSD: getopt.c,v 1.7 2006/07/09 21:38:47 wiz Exp $");
18 main(int argc
, char *argv
[])
23 optind
= 2; /* Past the program name and the option letters. */
24 while ((c
= getopt(argc
, argv
, argv
[1])) != -1)
27 status
= 1; /* getopt routine gave message */
31 printf(" -%c %s", c
, optarg
);
37 for (; optind
< argc
; optind
++)
38 printf(" %s", argv
[optind
]);