xref: /original-bsd/admin/style/getopt (revision 5e598c08)
1/*
2 * Main/getopt(3) fragment.
3 *
4 *	@(#)getopt	5.2 (Berkeley) 03/17/94
5 */
6
7#include <sys/types.h>
8
9#include <stdlib.h>
10
11void usage __P((void));
12
13int
14main(argc, argv)
15	int argc;
16	char *argv[];
17{
18	int ch;
19
20	while ((ch = getopt(argc, argv, "")) != EOF)
21		switch (ch) {
22		case '':
23			break;
24		case '?':
25		default:
26			usage();
27		}
28	argc -= optind;
29	argv += optind;
30}
31
32void
33usage()
34{
35	(void)fprintf(stderr, "usage: program:\n");
36	exit(1);
37}
38