From: Mikko Rasa Date: Tue, 27 Aug 2013 19:35:24 +0000 (+0300) Subject: Suppress usage errors if help is requested X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=a742e766dda1c04ba6f8c6b552a1b007ff3eb0ca Suppress usage errors if help is requested --- diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index f88d4a9..6d96f0b 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -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)