Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.
The new format works even if the translation of the strings
modifies the lenght of the message.
Sqashed 6 commits in a single one.
Help messages correctly formatted for SVGA text mode (132 chars)
Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.
The new format should work even if the translation of the strings
modifies the lenght of the message.
Fix - syntax error
Correct formatting for 79 chars
Correctly based on C++ functions
Removed spare spaces from option strings
Fix - syntax error
// When adding new options to the categories, please keep and ensure alphabetical ordering.
// When adding new options to the categories, please keep and ensure alphabetical ordering.
stringstrUsage=_("Options:")+"\n";
stringstrUsage=HelpMessageGroup(_("Options:"));
strUsage+=" -? "+_("This help message")+"\n";
strUsage+=HelpMessageOpt("-?",_("This help message"));
strUsage+=" -alertnotify=<cmd> "+_("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)")+"\n";
strUsage+=HelpMessageOpt("-alertnotify=<cmd>",_("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)"));
strUsage+=" -blocknotify=<cmd> "+_("Execute command when the best block changes (%s in cmd is replaced by block hash)")+"\n";
strUsage+=HelpMessageOpt("-blocknotify=<cmd>",_("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
strUsage+=" -checkblocks=<n> "+strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"),288)+"\n";
strUsage+=HelpMessageOpt("-checkblocks=<n>",strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"),288));
strUsage+=" -checklevel=<n> "+strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"),3)+"\n";
strUsage+=HelpMessageOpt("-checklevel=<n>",strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"),3));
strUsage+=" -daemon "+_("Run in the background as a daemon and accept commands")+"\n";
strUsage+=HelpMessageOpt("-daemon",_("Run in the background as a daemon and accept commands"));
#endif
#endif
}
}
strUsage+=" -datadir=<dir> "+_("Specify data directory")+"\n";
strUsage+=HelpMessageOpt("-datadir=<dir>",_("Specify data directory"));
strUsage+=" -dbcache=<n> "+strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"),nMinDbCache,nMaxDbCache,nDefaultDbCache)+"\n";
strUsage+=HelpMessageOpt("-dbcache=<n>",strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"),nMinDbCache,nMaxDbCache,nDefaultDbCache));
strUsage+=" -loadblock=<file> "+_("Imports blocks from external blk000??.dat file")+""+_("on startup")+"\n";
strUsage+=HelpMessageOpt("-loadblock=<file>",_("Imports blocks from external blk000??.dat file")+""+_("on startup"));
strUsage+=" -maxorphantx=<n> "+strprintf(_("Keep at most <n> unconnectable transactions in memory (default: %u)"),DEFAULT_MAX_ORPHAN_TRANSACTIONS)+"\n";
strUsage+=HelpMessageOpt("-maxorphantx=<n>",strprintf(_("Keep at most <n> unconnectable transactions in memory (default: %u)"),DEFAULT_MAX_ORPHAN_TRANSACTIONS));
strUsage+=" -par=<n> "+strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"),-(int)boost::thread::hardware_concurrency(),MAX_SCRIPTCHECK_THREADS,DEFAULT_SCRIPTCHECK_THREADS)+"\n";
strUsage+=HelpMessageOpt("-par=<n>",strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"),
strUsage+=" -reindex "+_("Rebuild block chain index from current blk000??.dat files")+""+_("on startup")+"\n";
strUsage+=HelpMessageOpt("-reindex",_("Rebuild block chain index from current blk000??.dat files")+""+_("on startup"));
#if !defined(WIN32)
#if !defined(WIN32)
strUsage+=" -sysperms "+_("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)")+"\n";
strUsage+=HelpMessageOpt("-sysperms",_("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)"));
#endif
#endif
strUsage+=" -txindex "+strprintf(_("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-txindex",strprintf(_("Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)"),0));
strUsage+=HelpMessageOpt("-timeout=<n>",strprintf(_("Specify connection timeout in milliseconds (minimum: 1, default: %d)"),DEFAULT_CONNECT_TIMEOUT));
#ifdef USE_UPNP
#ifdef USE_UPNP
#if USE_UPNP
#if USE_UPNP
strUsage+=" -upnp "+_("Use UPnP to map the listening port (default: 1 when listening)")+"\n";
strUsage+=HelpMessageOpt("-upnp",_("Use UPnP to map the listening port (default: 1 when listening)"));
#else
#else
strUsage+=" -upnp "+strprintf(_("Use UPnP to map the listening port (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-upnp",strprintf(_("Use UPnP to map the listening port (default: %u)"),0));
#endif
#endif
#endif
#endif
strUsage+=" -whitebind=<addr> "+_("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6")+"\n";
strUsage+=HelpMessageOpt("-whitebind=<addr>",_("Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6"));
strUsage+=" -whitelist=<netmask> "+_("Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.")+"\n";
strUsage+=HelpMessageOpt("-whitelist=<netmask>",_("Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times.")+
strUsage+=""+_("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway")+"\n";
""+_("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway"));
#ifdef ENABLE_WALLET
#ifdef ENABLE_WALLET
strUsage+="\n"+_("Wallet options:")+"\n";
strUsage+=HelpMessageGroup(_("Wallet options:"));
strUsage+=" -disablewallet "+_("Do not load the wallet and disable wallet RPC calls")+"\n";
strUsage+=HelpMessageOpt("-disablewallet",_("Do not load the wallet and disable wallet RPC calls"));
strUsage+=" -keypool=<n> "+strprintf(_("Set key pool size to <n> (default: %u)"),100)+"\n";
strUsage+=HelpMessageOpt("-keypool=<n>",strprintf(_("Set key pool size to <n> (default: %u)"),100));
if(GetBoolArg("-help-debug",false))
if(GetBoolArg("-help-debug",false))
strUsage+=" -mintxfee=<amt> "+strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"),FormatMoney(CWallet::minTxFee.GetFeePerK()))+"\n";
strUsage+=HelpMessageOpt("-mintxfee=<amt>",strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)"),
strUsage+=" -paytxfee=<amt> "+strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"),FormatMoney(payTxFee.GetFeePerK()))+"\n";
FormatMoney(CWallet::minTxFee.GetFeePerK())));
strUsage+=" -rescan "+_("Rescan the block chain for missing wallet transactions")+""+_("on startup")+"\n";
strUsage+=HelpMessageOpt("-paytxfee=<amt>",strprintf(_("Fee (in BTC/kB) to add to transactions you send (default: %s)"),FormatMoney(payTxFee.GetFeePerK())));
strUsage+=" -salvagewallet "+_("Attempt to recover private keys from a corrupt wallet.dat")+""+_("on startup")+"\n";
strUsage+=HelpMessageOpt("-rescan",_("Rescan the block chain for missing wallet transactions")+""+_("on startup"));
strUsage+=" -sendfreetransactions "+strprintf(_("Send transactions as zero-fee transactions if possible (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-salvagewallet",_("Attempt to recover private keys from a corrupt wallet.dat")+""+_("on startup"));
strUsage+=" -spendzeroconfchange "+strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"),1)+"\n";
strUsage+=HelpMessageOpt("-sendfreetransactions",strprintf(_("Send transactions as zero-fee transactions if possible (default: %u)"),0));
strUsage+=" -txconfirmtarget=<n> "+strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"),1)+"\n";
strUsage+=HelpMessageOpt("-spendzeroconfchange",strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"),1));
strUsage+=" -maxtxfee=<amt> "+strprintf(_("Maximum total fees to use in a single wallet transaction, setting too low may abort large transactions (default: %s)"),FormatMoney(maxTxFee))+"\n";
strUsage+=HelpMessageOpt("-txconfirmtarget=<n>",strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"),1));
strUsage+=" -upgradewallet "+_("Upgrade wallet to latest format")+""+_("on startup")+"\n";
strUsage+=HelpMessageOpt("-maxtxfee=<amt>",strprintf(_("Maximum total fees to use in a single wallet transaction, setting too low may abort large transactions (default: %s)"),
strUsage+=" -wallet=<file> "+_("Specify wallet file (within data directory)")+""+strprintf(_("(default: %s)"),"wallet.dat")+"\n";
FormatMoney(maxTxFee)));
strUsage+=" -walletnotify=<cmd> "+_("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)")+"\n";
strUsage+=HelpMessageOpt("-upgradewallet",_("Upgrade wallet to latest format")+""+_("on startup"));
strUsage+=" -zapwallettxes=<mode> "+_("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup")+"\n";
strUsage+=HelpMessageOpt("-wallet=<file>",_("Specify wallet file (within data directory)")+""+strprintf(_("(default: %s)"),"wallet.dat"));
strUsage+=""+_("(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)")+"\n";
strUsage+=HelpMessageOpt("-walletnotify=<cmd>",_("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)"));
strUsage+=HelpMessageOpt("-zapwallettxes=<mode>",_("Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup")+
""+_("(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)"));
strUsage+=" -genproclimit=<n> "+strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"),1)+"\n";
strUsage+=HelpMessageOpt("-genproclimit=<n>",strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"),1));
#endif
#endif
strUsage+=" -help-debug "+_("Show all debugging options (usage: --help -help-debug)")+"\n";
strUsage+=HelpMessageOpt("-help-debug",_("Show all debugging options (usage: --help -help-debug)"));
strUsage+=" -logips "+strprintf(_("Include IP addresses in debug output (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-logips",strprintf(_("Include IP addresses in debug output (default: %u)"),0));
strUsage+=" -logtimestamps "+strprintf(_("Prepend debug output with timestamp (default: %u)"),1)+"\n";
strUsage+=HelpMessageOpt("-logtimestamps",strprintf(_("Prepend debug output with timestamp (default: %u)"),1));
if(GetBoolArg("-help-debug",false))
if(GetBoolArg("-help-debug",false))
{
{
strUsage+=" -limitfreerelay=<n> "+strprintf(_("Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u)"),15)+"\n";
strUsage+=HelpMessageOpt("-limitfreerelay=<n>",strprintf(_("Continuously rate-limit free transactions to <n>*1000 bytes per minute (default:%u)"),15));
strUsage+=" -relaypriority "+strprintf(_("Require high priority for relaying free or low-fee transactions (default:%u)"),1)+"\n";
strUsage+=HelpMessageOpt("-relaypriority",strprintf(_("Require high priority for relaying free or low-fee transactions (default:%u)"),1));
strUsage+=" -maxsigcachesize=<n> "+strprintf(_("Limit size of signature cache to <n> entries (default: %u)"),50000)+"\n";
strUsage+=HelpMessageOpt("-maxsigcachesize=<n>",strprintf(_("Limit size of signature cache to <n> entries (default: %u)"),50000));
}
}
strUsage+=" -minrelaytxfee=<amt> "+strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"),FormatMoney(::minRelayTxFee.GetFeePerK()))+"\n";
strUsage+=HelpMessageOpt("-minrelaytxfee=<amt>",strprintf(_("Fees (in BTC/Kb) smaller than this are considered zero fee for relaying (default: %s)"),FormatMoney(::minRelayTxFee.GetFeePerK())));
strUsage+=" -printtoconsole "+_("Send trace/debug info to console instead of debug.log file")+"\n";
strUsage+=HelpMessageOpt("-printtoconsole",_("Send trace/debug info to console instead of debug.log file"));
if(GetBoolArg("-help-debug",false))
if(GetBoolArg("-help-debug",false))
{
{
strUsage+=" -printpriority "+strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-printpriority",strprintf(_("Log transaction priority and fee per kB when mining blocks (default: %u)"),0));
strUsage+=" -privdb "+strprintf(_("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"),1)+"\n";
strUsage+=HelpMessageOpt("-privdb",strprintf(_("Sets the DB_PRIVATE flag in the wallet db environment (default: %u)"),1));
strUsage+=" -regtest "+_("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.")+"\n";
strUsage+=HelpMessageOpt("-regtest",_("Enter regression test mode, which uses a special chain in which blocks can be solved instantly.")+""+
strUsage+=""+_("This is intended for regression testing tools and app development.")+"\n";
_("This is intended for regression testing tools and app development.")+""+
strUsage+=""+_("In this mode -genproclimit controls how many blocks are generated immediately.")+"\n";
_("In this mode -genproclimit controls how many blocks are generated immediately."));
}
}
strUsage+=" -shrinkdebugfile "+_("Shrink debug.log file on client startup (default: 1 when no -debug)")+"\n";
strUsage+=HelpMessageOpt("-shrinkdebugfile",_("Shrink debug.log file on client startup (default: 1 when no -debug)"));
strUsage+=" -testnet "+_("Use the test network")+"\n";
strUsage+=HelpMessageOpt("-testnet",_("Use the test network"));
strUsage+=" -datacarrier "+strprintf(_("Relay and mine data carrier transactions (default: %u)"),1)+"\n";
strUsage+=HelpMessageOpt("-datacarrier",strprintf(_("Relay and mine data carrier transactions (default: %u)"),1));
strUsage+=" -datacarriersize "+strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"),MAX_OP_RETURN_RELAY)+"\n";
strUsage+=HelpMessageOpt("-datacarriersize",strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"),MAX_OP_RETURN_RELAY));
strUsage+=" -blockminsize=<n> "+strprintf(_("Set minimum block size in bytes (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-blockminsize=<n>",strprintf(_("Set minimum block size in bytes (default: %u)"),0));
strUsage+=" -blockmaxsize=<n> "+strprintf(_("Set maximum block size in bytes (default: %d)"),DEFAULT_BLOCK_MAX_SIZE)+"\n";
strUsage+=HelpMessageOpt("-blockmaxsize=<n>",strprintf(_("Set maximum block size in bytes (default: %d)"),DEFAULT_BLOCK_MAX_SIZE));
strUsage+=" -blockprioritysize=<n> "+strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"),DEFAULT_BLOCK_PRIORITY_SIZE)+"\n";
strUsage+=HelpMessageOpt("-blockprioritysize=<n>",strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"),DEFAULT_BLOCK_PRIORITY_SIZE));
strUsage+="\n"+_("RPC server options:")+"\n";
strUsage+=HelpMessageGroup(_("RPC server options:"));
strUsage+=" -server "+_("Accept command line and JSON-RPC commands")+"\n";
strUsage+=HelpMessageOpt("-server",_("Accept command line and JSON-RPC commands"));
strUsage+=" -rest "+strprintf(_("Accept public REST requests (default: %u)"),0)+"\n";
strUsage+=HelpMessageOpt("-rest",strprintf(_("Accept public REST requests (default: %u)"),0));
strUsage+=" -rpcbind=<addr> "+_("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)")+"\n";
strUsage+=HelpMessageOpt("-rpcbind=<addr>",_("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)"));
strUsage+=" -rpcuser=<user> "+_("Username for JSON-RPC connections")+"\n";
strUsage+=HelpMessageOpt("-rpcuser=<user>",_("Username for JSON-RPC connections"));
strUsage+=" -rpcpassword=<pw> "+_("Password for JSON-RPC connections")+"\n";
strUsage+=HelpMessageOpt("-rpcpassword=<pw>",_("Password for JSON-RPC connections"));
strUsage+=" -rpcport=<port> "+strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"),8332,18332)+"\n";
strUsage+=HelpMessageOpt("-rpcport=<port>",strprintf(_("Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)"),8332,18332));
strUsage+=" -rpcallowip=<ip> "+_("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times")+"\n";
strUsage+=HelpMessageOpt("-rpcallowip=<ip>",_("Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
strUsage+=" -rpcthreads=<n> "+strprintf(_("Set the number of threads to service RPC calls (default: %d)"),4)+"\n";
strUsage+=HelpMessageOpt("-rpcthreads=<n>",strprintf(_("Set the number of threads to service RPC calls (default: %d)"),4));
strUsage+=" -rpckeepalive "+strprintf(_("RPC support for HTTP persistent connections (default: %d)"),1)+"\n";
strUsage+=HelpMessageOpt("-rpckeepalive",strprintf(_("RPC support for HTTP persistent connections (default: %d)"),1));
strUsage+="\n"+_("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)")+"\n";
strUsage+=HelpMessageGroup(_("RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions)"));
strUsage+=" -rpcssl "+_("Use OpenSSL (https) for JSON-RPC connections")+"\n";
strUsage+=HelpMessageOpt("-rpcssl",_("Use OpenSSL (https) for JSON-RPC connections"));