Index: clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp =================================================================== --- clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp +++ clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp @@ -18,6 +18,7 @@ #include "llvm/Support/Program.h" #include "llvm/Support/Signals.h" #include "llvm/Support/raw_ostream.h" +#include "clang/Basic/Version.h" #include #include #include @@ -153,7 +154,16 @@ int main(int argc, char *argv[]) { llvm::sys::PrintStackTraceOnErrorSignal(argv[0]); - llvm::cl::ParseCommandLineOptions(argc, argv, "clangd"); + llvm::cl::SetVersionPrinter([](llvm::raw_ostream &OS) { + OS << clang::getClangToolFullVersion("clangd") << "\n"; + }); + llvm::cl::ParseCommandLineOptions( + argc, argv, + "clangd is a language server that provides IDE-like features to editors. " + "\n\nIt should be used via an editor plugin rather than invoked directly." + "For more information, see:" + "\n\thttps://clang.llvm.org/extra/clangd.html" + "\n\thttps://microsoft.github.io/language-server-protocol/"); if (Test) { RunSynchronously = true; InputStyle = JSONStreamStyle::Delimited;