From 1c58e13bee6715c668e93cd4ec93bc5d5fd1a4ad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 29 Aug 2017 11:52:55 +0200 Subject: [PATCH] Hide commands that don't have a description These are assumed to be internal. --- src/nix/command.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nix/command.cc b/src/nix/command.cc index e88c834ab..f90d848f2 100644 --- a/src/nix/command.cc +++ b/src/nix/command.cc @@ -50,8 +50,11 @@ void MultiCommand::printHelp(const string & programName, std::ostream & out) out << "Available commands:\n"; Table2 table; - for (auto & command : commands) - table.push_back(std::make_pair(command.second->name(), command.second->description())); + for (auto & command : commands) { + auto descr = command.second->description(); + if (!descr.empty()) + table.push_back(std::make_pair(command.second->name(), descr)); + } printTable(out, table); out << "\n";