[PATCH] D65201: [clangd] Provide help text to users who run `clangd` in a terminal.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 01:00:45 PDT 2019


This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.
Closed by commit rL366992: [clangd] Provide help text to users who run `clangd` in a terminal. (authored by sammccall, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D65201?vs=211470&id=211682#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65201/new/

https://reviews.llvm.org/D65201

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
@@ -515,6 +515,11 @@
   if (Tracer)
     TracingSession.emplace(*Tracer);
 
+  // If a user ran `clangd` in a terminal without redirecting anything,
+  // it's somewhat likely they're confused about how to use clangd.
+  // Show them the help overview, which explains.
+  if (llvm::outs().is_displayed() && llvm::errs().is_displayed())
+    llvm::errs() << Overview << "\n";
   // Use buffered stream to stderr (we still flush each log message). Unbuffered
   // stream can cause significant (non-deterministic) latency for the logger.
   llvm::errs().SetBuffered();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65201.211682.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190725/7188a688/attachment.bin>


More information about the cfe-commits mailing list