diff options
author | Neozaru <neozaru@mailoo.org> | 2014-06-01 18:21:30 +0200 |
---|---|---|
committer | Neozaru <neozaru@mailoo.org> | 2014-06-01 18:21:30 +0200 |
commit | 8530629e22d88de4c2fd4d7d231b00c65d30100d (patch) | |
tree | 0890c9ee74331cd1f27093833718d3cf7eb20d26 /src/simplewallet/simplewallet.cpp | |
parent | simplewallet returns 0 when no error (diff) | |
parent | Merge branch '0.8.8update' (diff) | |
download | monero-8530629e22d88de4c2fd4d7d231b00c65d30100d.tar.xz |
Merge bitmonero@monero-project
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 7485f5cb1..dc45d9d74 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -38,7 +38,6 @@ namespace const command_line::arg_descriptor<std::string> arg_daemon_address = {"daemon-address", "Use daemon instance at <host>:<port>", ""}; const command_line::arg_descriptor<std::string> arg_daemon_host = {"daemon-host", "Use daemon instance at host <arg> instead of localhost", ""}; const command_line::arg_descriptor<std::string> arg_password = {"password", "Wallet password", "", true}; - const command_line::arg_descriptor<std::string> arg_exit_after_cmd = {"exit-after-cmd", "Will not enter in the CLI console after command execution. Default: false", ""}; const command_line::arg_descriptor<int> arg_daemon_port = {"daemon-port", "Use daemon instance at port <arg> instead of 8081", 0}; const command_line::arg_descriptor<uint32_t> arg_log_level = {"set_log", "", 0, true}; @@ -203,7 +202,7 @@ bool simple_wallet::set_log(const std::vector<std::string> &args) return true; } uint16_t l = 0; - if(!string_tools::get_xtype_from_string(l, args[0])) + if(!epee::string_tools::get_xtype_from_string(l, args[0])) { fail_msg_writer() << "wrong number format, use: set_log <log_level_number_0-4>"; return true; @@ -230,8 +229,8 @@ bool simple_wallet::ask_wallet_create_if_needed() wallet_path = string_tools::trim(wallet_path); bool keys_file_exists; - bool wallet_file_exitst; - tools::wallet2::wallet_exists(wallet_path, keys_file_exists, wallet_file_exitst); + bool wallet_file_exists; + tools::wallet2::wallet_exists(wallet_path, keys_file_exists, wallet_file_exists); bool r; if(keys_file_exists) @@ -240,7 +239,7 @@ bool simple_wallet::ask_wallet_create_if_needed() r = true; }else { - if(!wallet_file_exitst) + if(!wallet_file_exists) { std::cout << "The wallet doesn't exist, generating new one" << std::endl; m_generate_new = wallet_path; @@ -750,7 +749,7 @@ bool simple_wallet::transfer(const std::vector<std::string> &args_) } size_t fake_outs_count; - if(!string_tools::get_xtype_from_string(fake_outs_count, local_args[0])) + if(!epee::string_tools::get_xtype_from_string(fake_outs_count, local_args[0])) { fail_msg_writer() << "mixin_count should be non-negative integer, got " << local_args[0]; return true; @@ -929,7 +928,6 @@ int main(int argc, char* argv[]) command_line::add_arg(desc_params, arg_daemon_host); command_line::add_arg(desc_params, arg_daemon_port); command_line::add_arg(desc_params, arg_command); - command_line::add_arg(desc_params, arg_exit_after_cmd); command_line::add_arg(desc_params, arg_log_level); tools::wallet_rpc_server::init_options(desc_params); @@ -1056,20 +1054,20 @@ int main(int argc, char* argv[]) std::vector<std::string> command = command_line::get_arg(vm, arg_command); if (!command.empty()) + { w.process_command(command); - - tools::signal_handler::install([&w] { w.stop(); - }); - - const std::string& exit_after_command = command_line::get_arg(vm, arg_exit_after_cmd); - - /* Enters in CLI mode only if --exit-after-cmd is not set to true */ - if ( !boost::iequals(exit_after_command,"true") && !boost::iequals(exit_after_command,"yes") ) { - w.run(); + w.deinit(); } + else + { + tools::signal_handler::install([&w] { + w.stop(); + }); + w.run(); - w.deinit(); + w.deinit(); + } } return 0; //CATCH_ENTRY_L0("main", 1); |