Fix exit code of --help and --version, and test them in CI

Corrects prior regression which caused ERROR output and exit code of 1.
This commit is contained in:
Jan Haller 2022-07-02 01:05:20 +02:00
parent a2459c7d35
commit d38d76d039
9 changed files with 24 additions and 4 deletions

View file

@ -61,6 +61,10 @@ int main(int argc, char *argv[]) {
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
if (err != OK) {
free(cwd);
if (err == ERR_HELP) { // Returned by --help and --version, so success.
return 0;
}
return 255;
}