diff options
author | stoffu <stoffu@protonmail.ch> | 2018-04-15 14:52:53 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-04-22 11:48:44 +0900 |
commit | f36132a8370096adc953a7fcec69f55070eb2e71 (patch) | |
tree | 5d48ca9acb73a313e3c27426e497555d33140bc2 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #3670 (diff) | |
download | monero-f36132a8370096adc953a7fcec69f55070eb2e71.tar.xz |
wallet cli/rpc: terminate execution with code 0 when --help or --version is given
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index a9d211532..8dcdfd1b3 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -2895,7 +2895,9 @@ int main(int argc, char** argv) { command_line::add_arg(desc_params, arg_wallet_dir); command_line::add_arg(desc_params, arg_prompt_for_password); - const auto vm = wallet_args::main( + boost::optional<po::variables_map> vm; + bool should_terminate = false; + std::tie(vm, should_terminate) = wallet_args::main( argc, argv, "monero-wallet-rpc [--wallet-file=<file>|--generate-from-json=<file>|--wallet-dir=<directory>] [--rpc-bind-port=<port>]", tools::wallet_rpc_server::tr("This is the RPC monero wallet. It needs to connect to a monero\ndaemon to work correctly."), @@ -2909,6 +2911,10 @@ int main(int argc, char** argv) { { return 1; } + if (should_terminate) + { + return 0; + } std::unique_ptr<tools::wallet2> wal; try |