Return 1 on unrecognized option

This commit is contained in:
Arun Prakash Jana 2018-11-28 08:18:01 +05:30
parent 2a4cc85659
commit 8cba83f43f
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -3437,7 +3437,6 @@ static void usage(void)
" -v show program version\n" " -v show program version\n"
" -h show this help\n\n" " -h show this help\n\n"
"Version: %s\n%s\n", VERSION, GENERAL_INFO); "Version: %s\n%s\n", VERSION, GENERAL_INFO);
exit(0);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -3494,9 +3493,12 @@ int main(int argc, char *argv[])
case 'v': case 'v':
fprintf(stdout, "%s\n", VERSION); fprintf(stdout, "%s\n", VERSION);
return 0; return 0;
case 'h': // fallthrough case 'h':
usage();
return 0;
default: default:
usage(); usage();
exit(1);
} }
} }