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/simplewallet | |
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 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 639b394f3..ca10d3f3a 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -7505,7 +7505,9 @@ int main(int argc, char* argv[]) po::positional_options_description positional_options; positional_options.add(arg_command.name, -1); - 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-cli [--wallet-file=<file>|--generate-new-wallet=<file>] [<COMMAND>]", sw::tr("This is the command line monero wallet. It needs to connect to a monero\ndaemon to work correctly.\nWARNING: Do not reuse your Monero keys on an another fork, UNLESS this fork has key reuse mitigations built in. Doing so will harm your privacy."), @@ -7520,6 +7522,11 @@ int main(int argc, char* argv[]) return 1; } + if (should_terminate) + { + return 0; + } + cryptonote::simple_wallet w; const bool r = w.init(*vm); CHECK_AND_ASSERT_MES(r, 1, sw::tr("Failed to initialize wallet")); |