| 98 | static std::string *ProgName; |
| 99 | |
| 100 | static void PrintHelp() { |
| 101 | Printf("Usage:\n"); |
| 102 | auto Prog = ProgName->c_str(); |
| 103 | Printf("\nTo run fuzzing pass 0 or more directories.\n"); |
| 104 | Printf("%s [-flag1=val1 [-flag2=val2 ...] ] [dir1 [dir2 ...] ]\n", Prog); |
| 105 | |
| 106 | Printf("\nTo run individual tests without fuzzing pass 1 or more files:\n"); |
| 107 | Printf("%s [-flag1=val1 [-flag2=val2 ...] ] file1 [file2 ...]\n", Prog); |
| 108 | |
| 109 | Printf("\nFlags: (strictly in form -flag=value)\n"); |
| 110 | size_t MaxFlagLen = 0; |
| 111 | for (size_t F = 0; F < kNumFlags; F++) |
| 112 | MaxFlagLen = std::max(strlen(FlagDescriptions[F].Name), MaxFlagLen); |
| 113 | |
| 114 | for (size_t F = 0; F < kNumFlags; F++) { |
| 115 | const auto &D = FlagDescriptions[F]; |
| 116 | if (strstr(D.Description, "internal flag") == D.Description) continue; |
| 117 | Printf(" %s", D.Name); |
| 118 | for (size_t i = 0, n = MaxFlagLen - strlen(D.Name); i < n; i++) |
| 119 | Printf(" "); |
| 120 | Printf("\t"); |
| 121 | Printf("%d\t%s\n", D.Default, D.Description); |
| 122 | } |
| 123 | Printf("\nFlags starting with '--' will be ignored and " |
| 124 | "will be passed verbatim to subprocesses.\n"); |
| 125 | } |
| 126 | |
| 127 | static const char *FlagValue(const char *Param, const char *Name) { |
| 128 | size_t Len = strlen(Name); |
no test coverage detected