diff options
author | stoffu <stoffu@protonmail.ch> | 2018-03-04 17:00:21 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-03-05 11:19:06 +0900 |
commit | 55f8d917fdccc236ebc185917fe5504b62a4cfd2 (patch) | |
tree | e4fc8cedd21a78863977a72360a861a3c8ea487b /src/common/command_line.h | |
parent | command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (diff) | |
download | monero-55f8d917fdccc236ebc185917fe5504b62a4cfd2.tar.xz |
command_line::get_arg: remove 'required' for dependent args as they're always optional
Diffstat (limited to 'src/common/command_line.h')
-rw-r--r-- | src/common/command_line.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/command_line.h b/src/common/command_line.h index 7c48d94e4..2f64f5448 100644 --- a/src/common/command_line.h +++ b/src/common/command_line.h @@ -227,8 +227,8 @@ namespace command_line return vm[arg.name].defaulted(); } - template<typename T, bool required> - T get_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, required, true>& arg) + template<typename T> + T get_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, false, true>& arg) { return arg.depf(get_arg(vm, arg.ref), is_arg_defaulted(vm, arg), vm[arg.name].template as<T>()); } @@ -242,7 +242,7 @@ namespace command_line template<bool dependent> 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(vm, arg); } |