mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-01 05:03:52 +00:00
Allowing comma sep. options everywhere
This commit is contained in:
parent
9dea0cf2e9
commit
8b224fa7a9
@ -844,6 +844,18 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
Option* add_set(
|
||||||
|
std::string name, ///< The name, short,long
|
||||||
|
T &member, ///< The selected member of the set
|
||||||
|
std::set<T> options, ///< The set of posibilities
|
||||||
|
std::string discription, ///< Discription string
|
||||||
|
detail::Combiner opts, ///< The options (REQUIRED, DEFAULT, POSITIONAL, ARGS())
|
||||||
|
detail::Combiner opts2,
|
||||||
|
Args... args
|
||||||
|
) {
|
||||||
|
return add_set(name, member, options, discription, opts|opts2, args...);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//------------ MAKE STYLE ---------//
|
//------------ MAKE STYLE ---------//
|
||||||
@ -877,6 +889,17 @@ public:
|
|||||||
retval->typeval = detail::type_name<T>();
|
retval->typeval = detail::type_name<T>();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T = std::string, typename... Args>
|
||||||
|
Value<T> make_option(
|
||||||
|
std::string name, ///< The name, short,long
|
||||||
|
std::string discription,
|
||||||
|
detail::Combiner opts,
|
||||||
|
detail::Combiner opts2,
|
||||||
|
Args... args
|
||||||
|
) {
|
||||||
|
return make_option(name, discription, opts|opts2, args...);
|
||||||
|
}
|
||||||
|
|
||||||
/// Prototype for new output style with default
|
/// Prototype for new output style with default
|
||||||
template<typename T,
|
template<typename T,
|
||||||
@ -912,7 +935,7 @@ public:
|
|||||||
retval->defaultval = ot.str();
|
retval->defaultval = ot.str();
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prototype for new output style, vector
|
/// Prototype for new output style, vector
|
||||||
template<typename T,
|
template<typename T,
|
||||||
enable_if_t<is_vector<T>::value, detail::enabler> = detail::dummy>
|
enable_if_t<is_vector<T>::value, detail::enabler> = detail::dummy>
|
||||||
@ -943,6 +966,18 @@ public:
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
Value<T> make_option(
|
||||||
|
std::string name, ///< The name, short,long
|
||||||
|
const T& default_value,
|
||||||
|
std::string discription,
|
||||||
|
detail::Combiner opts,
|
||||||
|
detail::Combiner opts2,
|
||||||
|
Args... args
|
||||||
|
) {
|
||||||
|
return make_option(name, default_value, discription, opts|opts2, args...);
|
||||||
|
}
|
||||||
|
|
||||||
/// Prototype for new output style: flag
|
/// Prototype for new output style: flag
|
||||||
Value<int> make_flag(
|
Value<int> make_flag(
|
||||||
@ -998,7 +1033,18 @@ public:
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename T, typename... Args>
|
||||||
|
Value<T> make_set(
|
||||||
|
std::string name,
|
||||||
|
std::set<T> options,
|
||||||
|
std::string discription,
|
||||||
|
detail::Combiner opts,
|
||||||
|
detail::Combiner opts2,
|
||||||
|
Args... args
|
||||||
|
) {
|
||||||
|
return make_set(name, options, discription, opts|opts2, args...);
|
||||||
|
}
|
||||||
|
|
||||||
/// Parses the command line - throws errors
|
/// Parses the command line - throws errors
|
||||||
void parse(int argc, char **argv) {
|
void parse(int argc, char **argv) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user