From 95af125bf6b63940437060f7f04151a1618f803c Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Fri, 10 Oct 2014 18:03:06 +1100 Subject: [PATCH] fix adding missing options --- src/cxxopts.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cxxopts.cpp b/src/cxxopts.cpp index 2534be0..9ad20a3 100644 --- a/src/cxxopts.cpp +++ b/src/cxxopts.cpp @@ -259,8 +259,15 @@ Options::add_option { auto option = std::make_shared(desc, value); - add_one_option(s, option); - add_one_option(l, option); + if (s.size() > 0) + { + add_one_option(s, option); + } + + if (l.size() > 0) + { + add_one_option(l, option); + } //add the help details }