[PATCH] D61740: Simplify llvm-cat -help

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 09:09:22 PDT 2019


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: pcc.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Only output options that are directly relevant, and leave the remainder to the -help-hidden flag.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61740

Files:
  llvm/tools/llvm-cat/llvm-cat.cpp


Index: llvm/tools/llvm-cat/llvm-cat.cpp
===================================================================
--- llvm/tools/llvm-cat/llvm-cat.cpp
+++ llvm/tools/llvm-cat/llvm-cat.cpp
@@ -32,17 +32,23 @@
 
 using namespace llvm;
 
+cl::OptionCategory CatCategory("llvm-cat Options");
+
 static cl::opt<bool>
-    BinaryCat("b", cl::desc("Whether to perform binary concatenation"));
+    BinaryCat("b", cl::desc("Whether to perform binary concatenation"),
+              cl::cat(CatCategory));
 
 static cl::opt<std::string> OutputFilename("o", cl::Required,
                                            cl::desc("Output filename"),
-                                           cl::value_desc("filename"));
+                                           cl::value_desc("filename"),
+                                           cl::cat(CatCategory));
 
 static cl::list<std::string> InputFilenames(cl::Positional, cl::ZeroOrMore,
-                                            cl::desc("<input  files>"));
+                                            cl::desc("<input  files>"),
+                                            cl::cat(CatCategory));
 
 int main(int argc, char **argv) {
+  cl::HideUnrelatedOptions(CatCategory);
   cl::ParseCommandLineOptions(argc, argv, "Module concatenation");
 
   ExitOnError ExitOnErr("llvm-cat: ");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61740.198846.patch
Type: text/x-patch
Size: 1324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190509/0c4d0ecd/attachment.bin>


More information about the llvm-commits mailing list