mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 03:18:52 +00:00
command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318
This commit is contained in:
parent
9f9e095a8c
commit
450306a01c
@ -214,8 +214,8 @@ namespace command_line
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, bool required>
|
template<typename T, bool required, bool dependent>
|
||||||
bool has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, required>& arg)
|
typename std::enable_if<!std::is_same<T, bool>::value, bool>::type has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, required, dependent>& arg)
|
||||||
{
|
{
|
||||||
auto value = vm[arg.name];
|
auto value = vm[arg.name];
|
||||||
return !value.empty();
|
return !value.empty();
|
||||||
@ -239,8 +239,8 @@ namespace command_line
|
|||||||
return vm[arg.name].template as<T>();
|
return vm[arg.name].template as<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<bool dependent>
|
||||||
inline bool has_arg<bool, false>(const boost::program_options::variables_map& vm, const arg_descriptor<bool, false>& arg)
|
inline bool has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<bool, false, dependent>& arg)
|
||||||
{
|
{
|
||||||
return get_arg<bool, false>(vm, arg);
|
return get_arg<bool, false>(vm, arg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user