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