CommandLine: Exit successfully for -version and -help
Tools that use the CommandLine library currently exit with an error
when invoked with -version or -help. This is unusual and non-standard,
so we'll fix them to exit successfully instead.
I don't expect that anyone relies on the current behaviour, so this
should be a fairly safe change.
llvm-svn: 202530
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp
index e1317a2..9e80726 100644
--- a/llvm/lib/Support/CommandLine.cpp
+++ b/llvm/lib/Support/CommandLine.cpp
@@ -1496,7 +1496,7 @@
MoreHelp->clear();
// Halt the program since help information was printed
- exit(1);
+ exit(0);
}
};
@@ -1732,7 +1732,7 @@
if (OverrideVersionPrinter != 0) {
(*OverrideVersionPrinter)();
- exit(1);
+ exit(0);
}
print();
@@ -1746,7 +1746,7 @@
(*I)();
}
- exit(1);
+ exit(0);
}
};
} // End anonymous namespace