diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-03-11 10:12:20 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-03-11 10:20:59 +0100 |
| commit | d734d87b28ccbf2a4a4eb19a28285b5dea782105 (patch) | |
| tree | 854c7b98bfee26268436eedf10a054a2e93becea /src/util.cpp | |
| parent | Merge pull request #5864 (diff) | |
| parent | Fix - bitcoin-qt usage message (diff) | |
| download | discoin-d734d87b28ccbf2a4a4eb19a28285b5dea782105.tar.xz discoin-d734d87b28ccbf2a4a4eb19a28285b5dea782105.zip | |
Merge pull request #5749
f754707 Fix - bitcoin-qt usage message (Luca Venturini)
1fdb9fa Help messages correctly formatted (79 chars) (Luca Venturini)
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util.cpp b/src/util.cpp index 361b3631f..792f00b61 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -346,6 +346,21 @@ bool SoftSetBoolArg(const std::string& strArg, bool fValue) return SoftSetArg(strArg, std::string("0")); } +static const int screenWidth = 79; +static const int optIndent = 2; +static const int msgIndent = 7; + +std::string HelpMessageGroup(const std::string &message) { + return std::string(message) + std::string("\n\n"); +} + +std::string HelpMessageOpt(const std::string &option, const std::string &message) { + return std::string(optIndent,' ') + std::string(option) + + std::string("\n") + std::string(msgIndent,' ') + + FormatParagraph(message, screenWidth - msgIndent, msgIndent) + + std::string("\n\n"); +} + static std::string FormatException(const std::exception* pex, const char* pszThread) { #ifdef WIN32 |