Update error messages in daemon

When given a wrong argument, some daemon commands failed with "unknown
command" error, instead of a meaningful error message. This patch
brings consistency into the error messages.

In several places, this patch removes relatively useful messages,
and replaces them with more generic ones. E.g.,

-    std::cout << "use: print_pl [white] [gray] [<limit>] [pruned]
[publicrpc]" << std::endl;
+    std::cout << "Invalid syntax: Too many parameters. For more
details, use the help command." << std::endl;

There are two reasons for this:

1. Consistency.
2. Removing duplicates.

The detailed information about the parameters is present in
the help messages already. Having it in two places increases
the risk that the messages would get out of date.
This commit is contained in:
Tadeas Moravec
2020-09-18 14:04:19 +02:00
parent 7e78da7772
commit 83da867474
2 changed files with 203 additions and 101 deletions

View File

@@ -217,7 +217,8 @@ t_command_server::t_command_server(
m_command_lookup.set_handler(
"hard_fork_info"
, std::bind(&t_command_parser_executor::hard_fork_info, &m_parser, p::_1)
, "Print the hard fork voting information."
, "hard_fork_info <version>"
, "Print the hard fork voting information. If given a version, prints whether is this version enabled."
);
m_command_lookup.set_handler(
"bans"
@@ -308,6 +309,7 @@ t_command_server::t_command_server(
m_command_lookup.set_handler(
"prune_blockchain"
, std::bind(&t_command_parser_executor::prune_blockchain, &m_parser, p::_1)
, "prune_blockchain [confirm]"
, "Prune the blockchain."
);
m_command_lookup.set_handler(