Skip to content

Commit

Permalink
Prettify the man page version output
Browse files Browse the repository at this point in the history
(cherry picked from commit 10e1237)
  • Loading branch information
peternewman committed Jan 7, 2019
1 parent cb021b4 commit cf72607
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/base/Flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,15 @@ void FlagRegistry::GenManPage() {
str << " <" << flag->arg_type() << ">";
}
if (flag->short_opt()) {
short_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
if (flag->name() == FLAGS_version.name()) {
std::ostringstream help_str;
help_str << "Print\n.B " << exe_name << "\nversion information.";
short_flag_lines.push_back(
OptionPair(str.str(), help_str.str()));
} else {
short_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
}
} else {
long_flag_lines.push_back(
OptionPair(str.str(), iter->second->help()));
Expand Down

0 comments on commit cf72607

Please sign in to comment.