From: Mikko Rasa Date: Mon, 23 Sep 2013 20:02:30 +0000 (+0300) Subject: Don't print the configuration header in help for empty configuration X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=24af1ff16ad1584ee10ef7b9798f340048c5dfff;p=builder.git Don't print the configuration header in help for empty configuration --- 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"); + } } }