From 8b484dabec41c40b6553e965c1928d5c94f961e6 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 17 Mar 2018 13:27:24 +0100 Subject: [PATCH] Improve argument parser user experience See https://github.com/probonopd/linuxdeployqt/issues/256#issuecomment-373916136 The argument parser requires flags expecting a payload to be passed in the form -arg=payload. If not, it fails to recognize them and falsely reports "argument must not start with --". These usability issues should be gone with these two minor changes. --- tools/linuxdeployqt/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 1055476..0d535e5 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -416,11 +416,11 @@ int main(int argc, char **argv) LogDebug() << "Argument found:" << argument; int index = argument.indexOf("="); extraQtPlugins = QString(argument.mid(index + 1)).split(","); - } else if (argument.startsWith("-")) { - LogError() << "Error: arguments must not start with --, only -" << "\n"; + } else if (argument.startsWith("--")) { + LogError() << "Error: arguments must not start with --, only -:" << argument << "\n"; return 1; } else { - LogError() << "Unknown argument" << argument << "\n"; + LogError() << "Unknown argument:" << argument << "\n"; return 1; } }