Help messages correctly formatted (79 chars)
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
This commit is contained in:
15
src/util.cpp
15
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
|
||||
|
||||
Reference in New Issue
Block a user