aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-07-19 14:04:42 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-07-19 14:04:42 -0500
commit69502c4040e133276dc860096907eeb944652c13 (patch)
tree7574ed96199816bcbd87fce7057b7a2745ba5268 /src/simplewallet
parentMerge pull request #4061 (diff)
parentsimplewallet.sweep_all: show usage when parsing fails (diff)
downloadmonero-69502c4040e133276dc860096907eeb944652c13.tar.xz
Merge pull request #4062
13851b2 simplewallet.sweep_all: show usage when parsing fails (stoffu)
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 8bd97be61..b05b68e89 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -4969,10 +4969,14 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_)
//----------------------------------------------------------------------------------------------------
bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &args_)
{
- // sweep_all [index=<N1>[,<N2>,...]] [<ring_size>] <address> [<payment_id>]
+ auto print_usage = [below]()
+ {
+ fail_msg_writer() << boost::format(tr("usage: %s [index=<N1>[,<N2>,...]] [<priority>] [<ring_size>] <address> [<payment_id>]")) % (below ? "sweep_below" : "sweep_all");
+ };
if (args_.size() == 0)
{
fail_msg_writer() << tr("No address given");
+ print_usage();
return true;
}
@@ -4986,7 +4990,10 @@ bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &a
if (local_args.size() > 0 && local_args[0].substr(0, 6) == "index=")
{
if (!parse_subaddress_indices(local_args[0], subaddr_indices))
+ {
+ print_usage();
return true;
+ }
local_args.erase(local_args.begin());
}
@@ -5054,6 +5061,7 @@ bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &a
if(!r && local_args.size() == 3)
{
fail_msg_writer() << tr("payment id has invalid format, expected 16 or 64 character hex string: ") << payment_id_str;
+ print_usage();
return true;
}
if (payment_id_seen)
@@ -5064,6 +5072,7 @@ bool simple_wallet::sweep_main(uint64_t below, const std::vector<std::string> &a
if (!cryptonote::get_account_address_from_str_or_url(info, m_wallet->nettype(), local_args[0], oa_prompter))
{
fail_msg_writer() << tr("failed to parse address");
+ print_usage();
return true;
}