Commit 055aa9b2 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Beautify help output of flag names

Flags can be passed as "--any_flag" or "--any-flag". It seems that
people generally prefer the second form, but our help outputs the first
one. Avoid confusion by outputting the second form.

R=bmeurer@chromium.org

Change-Id: I21e07a7d2484ae78ccd27736f8373d53eb312818
Reviewed-on: https://chromium-review.googlesource.com/850692Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50376}
parent 05fe3643
...@@ -582,10 +582,13 @@ void FlagList::PrintHelp() { ...@@ -582,10 +582,13 @@ void FlagList::PrintHelp() {
" run the new debugging shell\n\n" " run the new debugging shell\n\n"
"Options:\n"; "Options:\n";
for (size_t i = 0; i < num_flags; ++i) { for (const Flag& f : flags) {
Flag* f = &flags[i]; os << " --";
os << " --" << f->name() << " (" << f->comment() << ")\n" for (const char* c = f.name(); *c != '\0'; ++c) {
<< " type: " << Type2String(f->type()) << " default: " << *f os << NormalizeChar(*c);
}
os << " (" << f.comment() << ")\n"
<< " type: " << Type2String(f.type()) << " default: " << f
<< "\n"; << "\n";
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment