/* $OpenBSD: getopt,v 1.5 2001/12/05 09:59:16 deraadt Exp $ */ /* * Main/getopt(3) fragment. * * from: @(#)getopt 5.3 (Berkeley) 3/28/94 */ #include #include void usage __P((void)); int main(argc, argv) int argc; char *argv[]; { int ch; while ((ch = getopt(argc, argv, "abcf:")) != -1) switch (ch) { case '': break; case '?': default: usage(); } argc -= optind; argv += optind; } void usage(void) { extern char *__progname; (void)fprintf(stderr, "usage: %s [-abc] [-f file]\n", __progname); exit(1); }