add --version support

https://github.com/MaskRay/ccls/issues/334
This commit is contained in:
firstlove 2019-03-23 20:08:58 +08:00
parent b7d9ced086
commit b44abe9b53

View File

@ -69,11 +69,11 @@ void CloseLog() { fclose(ccls::log::file); }
} // namespace
int main(int argc, char **argv) {
SetVersionPrinter([](llvm::raw_ostream &os) {
os << "ccls version: " << "0.20190314" << "\n";
});
TraceMe();
sys::PrintStackTraceOnErrorSignal(argv[0]);
cl::SetVersionPrinter([](raw_ostream &OS) {
OS << clang::getClangToolFullVersion("ccls") << "\n";
});
for (auto &I : TopLevelSubCommand->OptionsMap)
if (I.second->Category != &C)