diff --git a/src/main.cpp b/src/main.cpp index ea3a4aa9..70767693 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -59,10 +59,18 @@ void Q_DECL_UNUSED initRCCIconTheme() std::unique_ptr createApplication(int& argc, char* argv[]) { - for (int i = 1; i < argc; ++i) { - if (!qstrcmp(argv[i], "--exportTo")) + std::vector args(argv, argv + argc); + + const std::vector nonGUIOptions = {"--version", "-v", "--help", "-h", "--help-all", "--exportTo"}; + + // create command line app if one of the command-line only options are used + for (const std::string& arg : args) { + if (std::find(nonGUIOptions.begin(), nonGUIOptions.end(), arg) != nonGUIOptions.end()) { return std::make_unique(argc, argv); + } } + + // otherwise create full GUI QT app return std::make_unique(argc, argv); }