From dfc092d3a973a184142fd9d86a2301f58b02396f Mon Sep 17 00:00:00 2001 From: Neozaru Date: Wed, 28 May 2014 21:58:38 +0200 Subject: Fixed return status for '--help'. Fixed wallet name (use macro instead of 'bytecoin wallet' --- src/simplewallet/simplewallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 0f84b81de..158fa1d4f 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -944,7 +944,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - success_msg_writer() << "bytecoin wallet v" << PROJECT_VERSION_LONG; + success_msg_writer() << CRYPTONOTE_NAME << " wallet v" << PROJECT_VERSION_LONG; success_msg_writer() << "Usage: simplewallet [--wallet-file=|--generate-new-wallet=] [--daemon-address=:] []"; success_msg_writer() << desc_all << '\n' << w.get_commands_str(); return false; @@ -961,7 +961,7 @@ int main(int argc, char* argv[]) return true; }); if (!r) - return 1; + return 0; //set up logging options log_space::get_set_log_detalisation_level(true, LOG_LEVEL_2); -- cgit v1.2.3 From d2f44503a7d3d9cbf37bc1b44686b0b6f076212b Mon Sep 17 00:00:00 2001 From: Neozaru Date: Wed, 28 May 2014 22:21:52 +0200 Subject: Added '--exit-after-cmd' option in simplewallet --- src/simplewallet/simplewallet.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 158fa1d4f..b5f4b7a6f 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -38,6 +38,7 @@ namespace const command_line::arg_descriptor arg_daemon_address = {"daemon-address", "Use daemon instance at :", ""}; const command_line::arg_descriptor arg_daemon_host = {"daemon-host", "Use daemon instance at host instead of localhost", ""}; const command_line::arg_descriptor arg_password = {"password", "Wallet password", "", true}; + const command_line::arg_descriptor arg_exit_after_cmd = {"exit-after-cmd", "Will not enter in the CLI console after command execution. Default: false", ""}; const command_line::arg_descriptor arg_daemon_port = {"daemon-port", "Use daemon instance at port instead of 8081", 0}; const command_line::arg_descriptor arg_log_level = {"set_log", "", 0, true}; @@ -928,6 +929,7 @@ 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); @@ -1059,7 +1061,13 @@ int main(int argc, char* argv[]) tools::signal_handler::install([&w] { w.stop(); }); - w.run(); + + 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(); } -- cgit v1.2.3 From 506fd372ec78f3cb5c492fc981bbaac7936be8aa Mon Sep 17 00:00:00 2001 From: Neozaru Date: Wed, 28 May 2014 22:27:59 +0200 Subject: simplewallet returns 0 when no error --- src/simplewallet/simplewallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index b5f4b7a6f..7485f5cb1 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1071,6 +1071,6 @@ int main(int argc, char* argv[]) w.deinit(); } - return 1; + return 0; //CATCH_ENTRY_L0("main", 1); } -- cgit v1.2.3