wallet: fix --help and --version erroring out

This commit is contained in:
moneromooo-monero 2017-09-10 14:12:32 +01:00
parent 02e5dcd2fa
commit 55b91d8605
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 15 additions and 15 deletions

View File

@ -114,6 +114,21 @@ namespace wallet_args
auto parser = po::command_line_parser(argc, argv).options(desc_all).positional(positional_options); auto parser = po::command_line_parser(argc, argv).options(desc_all).positional(positional_options);
po::store(parser.run(), vm); po::store(parser.run(), vm);
if (command_line::get_arg(vm, command_line::arg_help))
{
tools::msg_writer() << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL;
tools::msg_writer() << wallet_args::tr("This is the command line monero wallet. It needs to connect to a monero\n"
"daemon to work correctly.") << ENDL;
tools::msg_writer() << wallet_args::tr("Usage:") << ENDL << " " << usage;
tools::msg_writer() << desc_all;
return false;
}
else if (command_line::get_arg(vm, command_line::arg_version))
{
tools::msg_writer() << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")";
return false;
}
if(command_line::has_arg(vm, arg_config_file)) if(command_line::has_arg(vm, arg_config_file))
{ {
std::string config = command_line::get_arg(vm, arg_config_file); std::string config = command_line::get_arg(vm, arg_config_file);
@ -147,21 +162,6 @@ namespace wallet_args
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
} }
if (command_line::get_arg(vm, command_line::arg_help))
{
tools::msg_writer() << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL;
tools::msg_writer() << wallet_args::tr("This is the command line monero wallet. It needs to connect to a monero\n"
"daemon to work correctly.") << ENDL;
tools::msg_writer() << wallet_args::tr("Usage:") << ENDL << " " << usage;
tools::msg_writer() << desc_all;
return boost::none;
}
else if (command_line::get_arg(vm, command_line::arg_version))
{
tools::msg_writer() << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")";
return boost::none;
}
if(command_line::has_arg(vm, arg_max_concurrency)) if(command_line::has_arg(vm, arg_max_concurrency))
tools::set_max_concurrency(command_line::get_arg(vm, arg_max_concurrency)); tools::set_max_concurrency(command_line::get_arg(vm, arg_max_concurrency));