[PATCH] D48634: [clangd] Improve output of --help and --version. NFC.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 27 05:12:44 PDT 2018
sammccall created this revision.
sammccall added a reviewer: ilya-biryukov.
Herald added subscribers: cfe-commits, jkorous, MaskRay, ioeric.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D48634
Files:
clangd/tool/ClangdMain.cpp
Index: clangd/tool/ClangdMain.cpp
===================================================================
--- clangd/tool/ClangdMain.cpp
+++ 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 <cstdlib>
#include <iostream>
#include <memory>
@@ -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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48634.153049.patch
Type: text/x-patch
Size: 1155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180627/7bd51a06/attachment-0001.bin>
More information about the cfe-commits
mailing list