13 #include <boost/filesystem/operations.hpp>
25 if (!boost::filesystem::is_directory(
GetDataDir(
false)))
27 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
mapArgs[
"-datadir"].c_str());
32 }
catch(std::exception &e) {
33 fprintf(stderr,
"Error reading configuration file: %s\n", e.what());
38 fprintf(stderr,
"Error: Invalid combination of -regtest and -testnet.\n");
45 std::string strUsage =
_(
"Bitcoin Core RPC client version") +
" " +
FormatFullVersion() +
"\n\n" +
47 " bitcoin-cli [options] <command> [params] " +
_(
"Send command to Bitcoin Core") +
"\n" +
48 " bitcoin-cli [options] help " +
_(
"List commands") +
"\n" +
49 " bitcoin-cli [options] help <command> " +
_(
"Get help for a command") +
"\n";
53 fprintf(stdout,
"%s", strUsage.c_str());
59 int main(
int argc,
char* argv[])
68 catch (std::exception& e) {
81 catch (std::exception& e) {
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
std::string HelpMessageCli(bool mainProgram)
Show help message for bitcoin-cli.
static bool AppInitRPC(int argc, char *argv[])
bool SelectParamsFromCommandLine()
Looks for -regtest or -testnet and then calls SelectParams as appropriate.
void PrintExceptionContinue(std::exception *pex, const char *pszThread)
int main(int argc, char *argv[])
int CommandLineRPC(int argc, char *argv[])
void ParseParameters(int argc, const char *const argv[])
void ReadConfigFile(map< string, string > &mapSettingsRet, map< string, vector< string > > &mapMultiSettingsRet)
string FormatFullVersion()
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
map< string, vector< string > > mapMultiArgs
map< string, string > mapArgs