aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-06 10:55:36 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-10-06 10:56:18 +0100
commit8f0cea6355ec38f58323953fb389b02cffc110ca (patch)
tree17fa740e4f46d411ee125c5c74c5e1163cf52cd6 /src/common
parentMerge pull request #2518 (diff)
downloadmonero-8f0cea6355ec38f58323953fb389b02cffc110ca.tar.xz
add a command_line function to check for defaulted options
Diffstat (limited to 'src/common')
-rw-r--r--src/common/command_line.h6
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)