]> git.tdb.fi Git - builder.git/commitdiff
Don't print the configuration header in help for empty configuration
authorMikko Rasa <tdb@tdb.fi>
Mon, 23 Sep 2013 20:02:30 +0000 (23:02 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 23 Sep 2013 20:02:30 +0000 (23:02 +0300)
source/buildercli.cpp

index a7dd1e23ff2402f94ab07a1b67ce85f0fb446801..7f6ee687728fbaeecc7ef526d0fb16bdb0b84f41 100644 (file)
@@ -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");
+               }
        }
 }