Commit 9b31ef38d8dd7d5e8f0f7139d644a123deadfcb5

Authored by Henry Fredrick Schreiner
1 parent 87d83914

Adding positional name to name

Showing 1 changed file with 2 additions and 0 deletions
include/CLI/Option.hpp
@@ -162,6 +162,8 @@ public: @@ -162,6 +162,8 @@ public:
162 /// Gets a , sep list of names. Does not include the positional name. 162 /// Gets a , sep list of names. Does not include the positional name.
163 std::string get_name() const { 163 std::string get_name() const {
164 std::vector<std::string> name_list; 164 std::vector<std::string> name_list;
  165 + if(pname.length() > 0)
  166 + name_list.push_back(pname);
165 for(const std::string& sname : snames) 167 for(const std::string& sname : snames)
166 name_list.push_back("-"+sname); 168 name_list.push_back("-"+sname);
167 for(const std::string& lname : lnames) 169 for(const std::string& lname : lnames)