[PATCH] D82001: [llvm] [CommandLine] Do not suggest really hidden opts in nearest lookup

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 06:26:26 PDT 2020


sammccall added a comment.

Sounds like a good idea to me.

Could you extend the "OptionErrorMessageSuggest" test in llvm/unittests/Support/CommandLineTest.cpp to cover this case?



================
Comment at: llvm/lib/Support/CommandLine.cpp:595
     Option *O = it->second;
+    // Do not suggest really hidden options (not shown in any help).
+    if (O->getOptionHiddenFlag() == ReallyHidden)
----------------
Rather than not considering them (and offering a worse option, which may be confusing) you might consider checking `Best` after the loop so we just offer no suggestion if the best one is hidden.

Not sure which behavior is better, up to you.


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

https://reviews.llvm.org/D82001





More information about the llvm-commits mailing list