#include int option_inside=0; int option_help=0; int optch; int option_parse(int argc, char **argv) { while ((optch = getopt(argc, argv, "ih:")) != -1) switch (optch) { case 'i': option_inside = 1; break; case 'h': option_help++; break; case '?': default: option_help++; } argc -= optind; argv += optind; return 0; }