From 24af1ff16ad1584ee10ef7b9798f340048c5dfff Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 23 Sep 2013 23:02:30 +0300 Subject: [PATCH] Don't print the configuration header in help for empty configuration --- source/buildercli.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/source/buildercli.cpp b/source/buildercli.cpp index a7dd1e2..7f6ee68 100644 --- a/source/buildercli.cpp +++ b/source/buildercli.cpp @@ -346,13 +346,18 @@ void BuilderCLI::package_help() IO::print(", "); IO::print((*i)->get_name()); } - IO::print("\n\nPackage configuration:\n"); - for(Config::OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i) + IO::print("\n"); + + if(!options.empty()) { - const Config::Option &opt = i->second; - IO::print(" %s: %s (%s)", opt.name, opt.description, opt.value); - if(opt.value!=opt.default_value) - IO::print(" [%s]", opt.default_value); - IO::print("\n"); + IO::print("\nPackage configuration:\n"); + for(Config::OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i) + { + const Config::Option &opt = i->second; + IO::print(" %s: %s (%s)", opt.name, opt.description, opt.value); + if(opt.value!=opt.default_value) + IO::print(" [%s]", opt.default_value); + IO::print("\n"); + } } } -- 2.43.0