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/blockchain_utilities | |
parent | Merge pull request #2518 (diff) | |
download | monero-8f0cea6355ec38f58323953fb389b02cffc110ca.tar.xz |
add a command_line function to check for defaulted options
Diffstat (limited to 'src/blockchain_utilities')
-rw-r--r-- | src/blockchain_utilities/blockchain_export.cpp | 2 | ||||
-rw-r--r-- | src/blockchain_utilities/blockchain_import.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index 20eca09f2..11f8f63ca 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -109,7 +109,7 @@ int main(int argc, char* argv[]) } mlog_configure(mlog_get_default_log_path("monero-blockchain-export.log"), true); - if (!vm["log-level"].defaulted()) + if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else mlog_set_log(std::string(std::to_string(log_level) + ",bcutil:INFO").c_str()); diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index d6302ea1d..55ef990aa 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -634,7 +634,7 @@ int main(int argc, char* argv[]) return 1; } - if (! opt_batch && ! vm["batch-size"].defaulted()) + if (! opt_batch && !command_line::is_arg_defaulted(vm, arg_batch_size)) { std::cerr << "Error: batch-size set, but batch option not enabled" << ENDL; return 1; @@ -644,7 +644,7 @@ int main(int argc, char* argv[]) std::cerr << "Error: batch-size must be > 0" << ENDL; return 1; } - if (opt_verify && vm["batch-size"].defaulted()) + if (opt_verify && command_line::is_arg_defaulted(vm, arg_batch_size)) { // usually want batch size default lower if verify on, so progress can be // frequently saved. @@ -663,7 +663,7 @@ int main(int argc, char* argv[]) db_arg_str = command_line::get_arg(vm, arg_database); mlog_configure(mlog_get_default_log_path("monero-blockchain-import.log"), true); - if (!vm["log-level"].defaulted()) + if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else mlog_set_log(std::string(std::to_string(log_level) + ",bcutil:INFO").c_str()); @@ -735,7 +735,7 @@ int main(int argc, char* argv[]) } core.get_blockchain_storage().get_db().set_batch_transactions(true); - if (! vm["pop-blocks"].defaulted()) + if (!command_line::is_arg_defaulted(vm, arg_pop_blocks)) { num_blocks = command_line::get_arg(vm, arg_pop_blocks); MINFO("height: " << core.get_blockchain_storage().get_current_blockchain_height()); @@ -744,7 +744,7 @@ int main(int argc, char* argv[]) return 0; } - if (! vm["drop-hard-fork"].defaulted()) + if (!command_line::is_arg_defaulted(vm, arg_drop_hf)) { MINFO("Dropping hard fork tables..."); core.get_blockchain_storage().get_db().drop_hard_fork_info(); |