Allow iterator inputs to parse_positional
This commit is contained in:
parent
95a48de820
commit
7c468aaf68
@ -9,6 +9,10 @@ options. The project adheres to semantic versioning.
|
||||
|
||||
* Allow integers to have leading zeroes.
|
||||
|
||||
### Added
|
||||
|
||||
* Iterator inputs to `parse_positional`.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fix a warning about possible loss of data.
|
||||
|
@ -1255,6 +1255,12 @@ namespace cxxopts
|
||||
void
|
||||
parse_positional(std::initializer_list<std::string> options);
|
||||
|
||||
template <typename Iterator>
|
||||
void
|
||||
parse_positional(Iterator begin, Iterator end) {
|
||||
parse_positional(std::vector<std::string>{begin, end});
|
||||
}
|
||||
|
||||
std::string
|
||||
help(const std::vector<std::string>& groups = {""}) const;
|
||||
|
||||
|
@ -145,7 +145,9 @@ TEST_CASE("All positional", "[positional]")
|
||||
auto argc = av.argc();
|
||||
auto argv = av.argv();
|
||||
|
||||
options.parse_positional({"positional"});
|
||||
std::vector<std::string> pos_names = {"positional"};
|
||||
|
||||
options.parse_positional(pos_names.begin(), pos_names.end());
|
||||
|
||||
auto result = options.parse(argc, argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user