From e80cb2e1326fc17dea162d0b34b473e6ba218f74 Mon Sep 17 00:00:00 2001 From: Glocke Date: Sun, 14 May 2017 13:37:25 +0200 Subject: Update getoptpp.hpp added comment for Options::add --- getoptpp.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/getoptpp.hpp b/getoptpp.hpp index 0eafe3f..1557206 100644 --- a/getoptpp.hpp +++ b/getoptpp.hpp @@ -49,8 +49,10 @@ void Options::add(std::string const & name, int has_arg, int val, Handle handle) } void Options::add(std::string const & name, int has_arg, int* flag, int val, Handle handle) { - int index = val; // let val be the option's unique identifier + // create a new option from the args options.push_back({name.data(), has_arg, flag, val}); + + int index = val; // let val be the option's unique identifier if (flag != nullptr) { // flag is not null, so the val is not used as identifier // so pick another one -- cgit v1.2.3