1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

nix --help: Show short flags

This commit is contained in:
Eelco Dolstra 2016-04-21 14:34:46 +02:00
parent ddea253ff8
commit 1b0088ebb2
2 changed files with 6 additions and 4 deletions

View file

@ -71,10 +71,11 @@ void Args::printHelp(const string & programName, std::ostream & out)
void Args::printFlags(std::ostream & out)
{
Table2 table;
for (auto & flags : longFlags)
for (auto & flag : longFlags)
table.push_back(std::make_pair(
"--" + flags.first + renderLabels(flags.second.labels),
flags.second.description));
(flag.second.shortName ? std::string("-") + flag.second.shortName + ", " : " ")
+ "--" + flag.first + renderLabels(flag.second.labels),
flag.second.description));
printTable(out, table);
}