refs #846, allow to display cmdLineErrorMessage by BlackMisc::CStatusMessageList

Improved formatting and HTL escape message
This commit is contained in:
Klaus Basan
2016-12-29 00:49:33 +01:00
committed by Mathew Sutcliffe
parent 62f2593486
commit d6235d901e
4 changed files with 39 additions and 6 deletions

View File

@@ -866,6 +866,15 @@ namespace BlackCore
fputs(qPrintable(this->m_parser.helpText()), stderr);
}
void CApplication::cmdLineErrorMessage(const CStatusMessageList &msgs) const
{
if (msgs.isEmpty()) { return; }
if (!msgs.hasErrorMessages()) { return; }
return CApplication::cmdLineErrorMessage(
msgs.toFormattedQString(true)
);
}
void CApplication::cmdLineHelpMessage()
{
this->m_parser.showHelp(); // terminates

View File

@@ -241,15 +241,18 @@ namespace BlackCore
//! Delegates to QCommandLineParser::value
QString getParserValue(const QCommandLineOption &option) const;
//! Display parser error message
virtual void cmdLineErrorMessage(const QString &cmdLineErrorMessage) const;
//! Parses and handles the standard options such as help, version, parse error
//! \note in some cases (error, version, help) application is terminated during this step
//! \sa parsingHookIn
bool parse();
//! @}
//! Display error message
virtual void cmdLineErrorMessage(const QString &cmdLineErrorMessage) const;
//! Display error message
virtual void cmdLineErrorMessage(const BlackMisc::CStatusMessageList &msgs) const;
// ----------------------- contexts ----------------------------------------
//! \name Context / core facade related