/* * Run as: * * $ ./prog -f 1 (which will work). * $ ./prog -f -1 (which will fail). * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include int foos; static NihOption options[] = { { 'f', "foos", N_("number of foos"), NULL, "FOOS", &foos, nih_option_int }, NIH_OPTION_LAST }; int main (int argc, char *argv[]) { char **args; nih_main_init_full(argv[0], argv[0], "0.1", "email@foo.com", "Copyright goes here"); args = nih_option_parser(NULL, argc, argv, options, FALSE); nih_assert (args); exit (EXIT_SUCCESS); }