aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-10-15 18:38:46 +0200
committerRiccardo Spagni <ric@spagni.net>2017-10-15 18:38:46 +0200
commit1280ba4f5ba89f74f9394122dc8a91bb12876d00 (patch)
tree80100180b80b15c5649a3ff5e3985ccbada8a5a7 /src/common
parentMerge pull request #2587 (diff)
parentadd a command_line function to check for defaulted options (diff)
downloadmonero-1280ba4f5ba89f74f9394122dc8a91bb12876d00.tar.xz
Merge pull request #2589
8f0cea63 add a command_line function to check for defaulted options (moneromooo-monero)
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)