diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-06 10:55:36 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-06 10:56:18 +0100 |
commit | 8f0cea6355ec38f58323953fb389b02cffc110ca (patch) | |
tree | 17fa740e4f46d411ee125c5c74c5e1163cf52cd6 /src/common/command_line.h | |
parent | Merge pull request #2518 (diff) | |
download | monero-8f0cea6355ec38f58323953fb389b02cffc110ca.tar.xz |
add a command_line function to check for defaulted options
Diffstat (limited to '')
-rw-r--r-- | src/common/command_line.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/command_line.h b/src/common/command_line.h index d4231acd0..04fd70be5 100644 --- a/src/common/command_line.h +++ b/src/common/command_line.h @@ -189,6 +189,12 @@ namespace command_line return !value.empty(); } + template<typename T, bool required> + bool is_arg_defaulted(const boost::program_options::variables_map& vm, const arg_descriptor<T, required>& arg) + { + 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>& arg) |