From a6099ef319a73e2255dca77065600abb22c4f5f8 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 29 Oct 2013 22:29:44 +1100 Subject: Issue #1865 - Clean up RPC help messages Based on the proposal, update the help message of rpc methods - strings arguments are in double quotes rather than square brackets - numeric arguments have no quotes (and no default value) - optional parameters are surrounded by round brackets - json arguments are strings but don't use double quotes Added 3 sections for the details - Arguments: lists each argument, it's type, required or not, a default, and a description - Result: The method result, with json format if applicable, type, and a description - Examples: examples calls using bitcoin-cli and curl for json rpc call Problems - maybe this is too verbose - lines might be too long - description are not good or complete - examples may be too much --- src/bitcoinrpc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/bitcoinrpc.cpp') diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 6ecb70309b..c715f13fd2 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -189,8 +189,13 @@ Value help(const Array& params, bool fHelp) { if (fHelp || params.size() > 1) throw runtime_error( - "help [command]\n" - "List commands, or get help for a command."); + "help ( \"command\" )\n" + "\nList all commands, or get help for a specified command.\n" + "\nArguments:\n" + "1. \"command\" (string, optional) The command to get help on\n" + "\nResult:\n" + "\"text\" (string) The help text\n" + ); string strCommand; if (params.size() > 0) @@ -206,7 +211,7 @@ Value stop(const Array& params, bool fHelp) if (fHelp || params.size() > 1) throw runtime_error( "stop\n" - "Stop Bitcoin server."); + "\nStop Bitcoin server."); // Shutdown will take long enough that the response should get back StartShutdown(); return "Bitcoin server stopping"; -- cgit v1.2.3