Lines Matching refs:argv
25 static int (*last_do_help)(int argc, char **argv);
52 static int do_help(int argc, char **argv) in do_help() argument
73 static int do_version(int argc, char **argv) in do_version() argument
115 int cmd_select(const struct cmd *cmds, int argc, char **argv, in cmd_select() argument
116 int (*help)(int argc, char **argv)) in cmd_select()
121 last_argv = argv; in cmd_select()
125 return cmds[0].func(argc, argv); in cmd_select()
128 if (is_prefix(*argv, cmds[i].cmd)) { in cmd_select()
134 return cmds[i].func(argc - 1, argv + 1); in cmd_select()
138 help(argc - 1, argv + 1); in cmd_select()
251 static int do_batch(int argc, char **argv);
271 static int do_batch(int argc, char **argv) in do_batch() argument
285 } else if (!is_prefix(*argv, "file")) { in do_batch()
286 p_err("expected 'file', got: %s", *argv); in do_batch()
294 if (!strcmp(*argv, "-")) in do_batch()
297 fp = fopen(*argv, "r"); in do_batch()
299 p_err("Can't open file (%s): %s", *argv, strerror(errno)); in do_batch()
386 int main(int argc, char **argv) in main() argument
408 bin_name = argv[0]; in main()
411 while ((opt = getopt_long(argc, argv, "VhpjfLmndB:", in main()
415 return do_version(argc, argv); in main()
417 return do_help(argc, argv); in main()
458 p_err("unrecognized option '%s'", argv[optind - 1]); in main()
467 argv += optind; in main()
471 ret = cmd_select(cmds, argc, argv, do_help); in main()