[PATCH] D48634: [clangd] Improve output of --help and --version. NFC.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 29 06:29:00 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL335972: [clangd] Improve output of --help and --version. NFC. (authored by sammccall, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D48634

Files:
  clang-tools-extra/trunk/clangd/tool/ClangdMain.cpp


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 <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.153485.patch
Type: text/x-patch
Size: 1227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180629/d7abb1ab/attachment.bin>


More information about the llvm-commits mailing list