common : print usage on '-h' and '--help' (#6145)

This commit is contained in:
DAN™ 2024-03-19 01:59:36 -04:00 committed by GitHub
parent 2d15886bb0
commit 4c28b82529
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1056,7 +1056,8 @@ static bool gpt_params_find_arg(int argc, char ** argv, gpt_params & params, int
return true; return true;
} }
if (arg == "-h" || arg == "--help") { if (arg == "-h" || arg == "--help") {
return false; gpt_print_usage(argc, argv, gpt_params());
exit(0);
} }
if (arg == "--version") { if (arg == "--version") {
fprintf(stderr, "version: %d (%s)\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT); fprintf(stderr, "version: %d (%s)\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT);