/* $OpenBSD: getopt,v 1.3 2000/03/02 14:46:51 todd 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, "")) != -1) switch (ch) { case '': break; case '?': default: usage(); } argc -= optind; argv += optind; } void usage() { (void)fprintf(stderr, "usage: program [-abc] [-f file]\n"); exit(1); }