<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
+/// \brief Top level help.<br>
+int help_main(int argc, const char **argv) {<br></blockquote><div><br></div><div>Naming convention...</div><div><br></div><div>Though I've just noticed the entire file doesn't follow it so... feel free to rename? :)</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ errs() << "OVERVIEW: LLVM code coverage tool\n\n"<br>
+ << "USAGE: llvm-cov {gcov|report|show}\n";<br>
+ return 0;<br></blockquote><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+}<br>
+<br>
int main(int argc, const char **argv) {<br>
// If argv[0] is or ends with 'gcov', always be gcov compatible<br>
if (sys::path::stem(argv[0]).<u></u>endswith_lower("gcov"))<br>
@@ -37,17 +45,15 @@ int main(int argc, const char **argv) {<br>
<br>
// Check if we are invoking a specific tool command.<br>
if (argc > 1) {<br>
- int (*func)(int, const char **) = nullptr;<br>
-<br>
- StringRef command = argv[1];<br>
- if (command.equals_lower("show"))<br>
- func = show_main;<br>
- else if (command.equals_lower("report"<u></u>))<br>
- func = report_main;<br>
- else if (command.equals_lower("<u></u>convert-for-testing"))<br>
- func = convert_for_testing_main;<br>
- else if (command.equals_lower("gcov"))<br>
- func = gcov_main;<br>
+ typedef int (*MainFunction)(int, const char **);<br>
+ MainFunction func =<br>
+ StringSwitch<MainFunction>(<u></u>argv[1])<br>
+ .Case("convert-for-testing", convert_for_testing_main)<br>
+ .Case("gcov", gcov_main)<br>
+ .Case("report", report_main)<br>
+ .Case("show", show_main)<br>
+ .Cases("-h", "-help", "--help", help_main)<br>
+ .Default(nullptr);<br>
<br>
if (func) {<br>
std::string Invocation = std::string(argv[0]) + " " + argv[1];<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
</blockquote></div>