20 #include <boost/filesystem/operations.hpp>
26 static bool AppInitRPC(
int argc,
char* argv[])
32 if (!boost::filesystem::is_directory(
GetDataDir(
false)))
34 fprintf(stderr,
"Error: Specified data directory \"%s\" does not exist.\n",
mapArgs[
"-datadir"].c_str());
39 }
catch(std::exception &e) {
40 fprintf(stderr,
"Error reading configuration file: %s\n", e.what());
45 fprintf(stderr,
"Error: Invalid combination of -regtest and -testnet.\n");
52 std::string strUsage =
_(
"Anoncoin Core RPC client version") +
" " +
FormatFullVersion() +
"\n\n" +
54 " anoncoin-cli [options] <command> [params] " +
_(
"Send command to Anoncoin Core") +
"\n" +
55 " anoncoin-cli [options] help " +
_(
"List commands") +
"\n" +
56 " anoncoin-cli [options] help <command> " +
_(
"Get help for a command") +
"\n";
60 fprintf(stdout,
"%s", strUsage.c_str());
66 int main(
int argc,
char* argv[])
72 if(!AppInitRPC(argc, argv))
75 catch (std::exception& e) {
83 int ret = EXIT_FAILURE;
88 catch (std::exception& e) {
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
std::string HelpMessageCli(bool mainProgram)
Show help message for anoncoin-cli.
bool SelectParamsFromCommandLine()
Looks for -regtest or -testnet and then calls SelectParams as appropriate.
void PrintExceptionContinue(std::exception *pex, const char *pszThread)
int CommandLineRPC(int argc, char *argv[])
void ParseParameters(int argc, const char *const argv[])
std::string FormatFullVersion()
void ReadConfigFile(map< string, string > &mapSettingsRet, map< string, vector< string > > &mapMultiSettingsRet)
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
int main(int argc, char *argv[])