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

@@ -241,7 +241,12 @@ int main(int argc, char *argv[]) {
bool isRaw = parser.isSet(rawImageOption);
// Not a valid command
if (!isRaw && !toClipboard && pathValue.isEmpty()) {
QTextStream(stdout) << "you have to set a valid flag:\n\n";
QTextStream out(stdout);
out << "Invalid format, set where to save the content with one of "
<< "the following flags:\n "
<< pathOption.dashedNames().join(", ") << "\n "
<< rawImageOption.dashedNames().join(", ") << "\n "
<< clipboardOption.dashedNames().join(", ") << "\n\n";
parser.parse(QStringList() << argv[0] << "full" << "-h");
goto finish;
}