/* $OpenBSD: getopt,v 1.7 2002/07/22 20:13:14 pvalchev Exp $ */ /*- * Main/getopt(3) fragment. */ #include #include __SCCSID("@(#)getopt 5.3 (Berkeley) 3/28/94"); __RCSID("$MirOS: src/share/misc/getopt,v 1.2 2006/10/17 21:39:32 tg Exp $"); __RCSID("$Id$"); static __dead void usage(void); int main(int argc, char *argv[]) { int ch; while ((ch = getopt(argc, argv, "abcf:")) != -1) switch (ch) { case '': break; case '?': default: usage(); } argc -= optind; argv += optind; } static void usage(void) { extern const char *__progname; fprintf(stderr, "usage:\t%s [-abc] [-f file]\n", __progname); exit(1); }