[PATCH] D61870: Have cl::HideUnrelatedOptions just Hide and not ReallyHide options
serge via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 13 13:23:48 PDT 2019
serge-sans-paille created this revision.
serge-sans-paille added a reviewer: lebedev.ri.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
That way one can use cl::HideUnrelatedOptions to hide non-critical
options in tools like llvm-cat etc, but still give access to these
options though -help-hidden
https://reviews.llvm.org/D61870
Files:
llvm/lib/Support/CommandLine.cpp
llvm/unittests/Support/CommandLineTest.cpp
Index: llvm/unittests/Support/CommandLineTest.cpp
===================================================================
--- llvm/unittests/Support/CommandLineTest.cpp
+++ llvm/unittests/Support/CommandLineTest.cpp
@@ -380,15 +380,15 @@
cl::HideUnrelatedOptions(TestCategory);
- ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag())
+ ASSERT_EQ(cl::Hidden, TestOption1.getOptionHiddenFlag())
<< "Failed to hide extra option.";
ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag())
- << "Hid extra option that should be visable.";
+ << "Hid extra option that should be visible.";
StringMap<cl::Option *> &Map =
cl::getRegisteredOptions(*cl::TopLevelSubCommand);
ASSERT_EQ(cl::NotHidden, Map["help"]->getOptionHiddenFlag())
- << "Hid default option that should be visable.";
+ << "Hid default option that should be visible.";
}
cl::OptionCategory TestCategory2("Test Options set 2", "Description");
@@ -403,7 +403,7 @@
cl::HideUnrelatedOptions(makeArrayRef(VisibleCategories));
- ASSERT_EQ(cl::ReallyHidden, TestOption1.getOptionHiddenFlag())
+ ASSERT_EQ(cl::Hidden, TestOption1.getOptionHiddenFlag())
<< "Failed to hide extra option.";
ASSERT_EQ(cl::NotHidden, TestOption2.getOptionHiddenFlag())
<< "Hid extra option that should be visable.";
Index: llvm/lib/Support/CommandLine.cpp
===================================================================
--- llvm/lib/Support/CommandLine.cpp
+++ llvm/lib/Support/CommandLine.cpp
@@ -2427,7 +2427,7 @@
for (auto &Cat : I.second->Categories) {
if (Cat != &Category &&
Cat != &GenericCategory)
- I.second->setHiddenFlag(cl::ReallyHidden);
+ I.second->setHiddenFlag(cl::Hidden);
}
}
}
@@ -2437,7 +2437,7 @@
for (auto &I : Sub.OptionsMap) {
for (auto &Cat : I.second->Categories) {
if (find(Categories, Cat) == Categories.end() && Cat != &GenericCategory)
- I.second->setHiddenFlag(cl::ReallyHidden);
+ I.second->setHiddenFlag(cl::Hidden);
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61870.199319.patch
Type: text/x-patch
Size: 2066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190513/03e98fbe/attachment.bin>
More information about the llvm-commits
mailing list