]> git.tdb.fi Git - libs/core.git/commitdiff
Suppress usage errors if help is requested
authorMikko Rasa <tdb@tdb.fi>
Tue, 27 Aug 2013 19:35:24 +0000 (22:35 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 27 Aug 2013 19:35:24 +0000 (22:35 +0300)
source/core/getopt.cpp

index f88d4a92ac5a2c972eb0fba77cede64766d50126..6d96f0b335a568801170f79394ed7886acae1d0b 100644 (file)
@@ -137,7 +137,8 @@ void GetOpt::operator()(unsigned argc, const char *const *argv)
        }
        catch(const usage_error &e)
        {
-               throw usage_error(e.what(), "Usage: "+generate_usage(argv[0]));
+               if(!help)
+                       throw usage_error(e.what(), "Usage: "+generate_usage(argv[0]));
        }
 
        if(help)