diff options
author | Jonah BrĂ¼chert <jbb@kaidan.im> | 2022-05-27 00:07:22 +0200 |
---|---|---|
committer | Jonah BrĂ¼chert <jbb@kaidan.im> | 2022-05-30 19:22:46 +0200 |
commit | 711badae7c51409223b0fbb3a15bc0d35a3a8f5e (patch) | |
tree | 416bc380e4a3540566b97377570a743f0da4299b /tools | |
parent | feff2898fe6b457ed9f999c110bb89dea042285b (diff) |
qmltc: Handle missing command line arguments in a more friendly way
qmltc now shows a helpful error message if no C++ file or no C++ header
file argument was passed instead of hitting internal assertions.
Change-Id: I859426f95001b22aff41f391cddf1327e31425b8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmltc/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp index fa30f311fd..1e94fffde7 100644 --- a/tools/qmltc/main.cpp +++ b/tools/qmltc/main.cpp @@ -194,6 +194,15 @@ int main(int argc, char **argv) info.resourcePath = paths.first(); info.outputNamespace = parser.value(namespaceOption); + if (info.outputCppFile.isEmpty()) { + fprintf(stderr, "An output C++ file is required. Pass one using --impl"); + return EXIT_FAILURE; + } + if (info.outputHFile.isEmpty()) { + fprintf(stderr, "An output C++ header file is required. Pass one using --header"); + return EXIT_FAILURE; + } + QQmlJSImporter importer { importPaths, &mapper }; QQmlJSLogger logger; logger.setFileName(url); |