Command parser: Improve flameshot full error message

This commit is contained in:
lupoDharkael
2018-04-23 19:30:07 +02:00
parent 17ac6f7a35
commit 73b9609c54
4 changed files with 22 additions and 16 deletions

View File

@@ -48,6 +48,18 @@ QStringList CommandOption::names() const {
return m_names;
}
QStringList CommandOption::dashedNames() const {
QStringList dashedNames;
for (const QString &name: m_names) {
// prepend "-" to single character options, and "--" to the others
QString dashedName = (name.length() == 1) ?
QStringLiteral("-%1").arg(name) :
QStringLiteral("--%1").arg(name);
dashedNames << dashedName;
}
return dashedNames;
}
void CommandOption::setValueName(const QString &name) {
m_valueName = name;
}