From a742e766dda1c04ba6f8c6b552a1b007ff3eb0ca Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 27 Aug 2013 22:35:24 +0300 Subject: [PATCH] Suppress usage errors if help is requested --- source/core/getopt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.45.2