From b548dd3a6f369e5a244fdcdca55061513026f82a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 30 May 2018 23:23:38 +1000 Subject: Change option lists to be specified as separate arguments on commands line Option lists and maps are specified using separate arguments, avoiding the need for additional escaping of their separator and reusing the existing command line spliting logic instead. As discussed on #2087, this should make it much easier to work with list options, and make the general option system feel cleaner. --- src/parameters_parser.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/parameters_parser.hh') diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index 8cbaf0fd..0f9f83dc 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -6,6 +6,7 @@ #include "meta.hh" #include "array_view.hh" #include "optional.hh" +#include "flags.hh" #include "string.hh" #include "string_utils.hh" @@ -115,6 +116,12 @@ struct ParametersParser return m_params[m_positional_indices[index]]; } + ConstArrayView positionals_from(size_t first) const + { + kak_assert(m_desc.flags & (ParameterDesc::Flags::SwitchesOnlyAtStart | ParameterDesc::Flags::SwitchesAsPositional)); + return m_params.subrange(m_positional_indices[first]); + } + iterator begin() const { return iterator(*this, 0); } iterator end() const { return iterator(*this, m_positional_indices.size()); } -- cgit v1.2.3