Function to check if the next argument exists
| 12 | |
| 13 | // Function to check if the next argument exists |
| 14 | static std::string get_next_arg(int& i, int argc, char** argv, const std::string& flag, gpt_params& params) { |
| 15 | if (i + 1 < argc && argv[i + 1][0] != '-') { |
| 16 | return argv[++i]; |
| 17 | } else { |
| 18 | fprintf(stderr, "error: %s requires one argument.\n", flag.c_str()); |
| 19 | gpt_print_usage(argc, argv, params); |
| 20 | exit(0); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | bool gpt_params_parse(int argc, char ** argv, gpt_params & params) { |
| 25 | for (int i = 1; i < argc; i++) { |
no test coverage detected