diff options
author | Glocke <cgloeckner@freenet.de> | 2017-05-14 13:37:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-14 13:37:25 +0200 |
commit | e80cb2e1326fc17dea162d0b34b473e6ba218f74 (patch) | |
tree | 94af9b34d3a0dd88e79396bf2feecedd782a8f1f /getoptpp.hpp | |
parent | 607f05ab3bd8ef9b7625165fd916594edc19d06b (diff) |
Update getoptpp.hpp
added comment for Options::add
Diffstat (limited to 'getoptpp.hpp')
-rw-r--r-- | getoptpp.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 |