+ std::shared_ptr<AbstractCliParser> cliParser;
+
+#ifdef HAVE_KDE4
+ // We need to init KCmdLineArgs first
+ KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(),
+ ki18n("A modern, distributed IRC client"));
+ aboutData.addLicense(KAboutData::License_GPL_V2);
+ aboutData.addLicense(KAboutData::License_GPL_V3);
+ aboutData.setBugAddress("https://bugs.quassel-irc.org/projects/quassel-irc/issues/new");
+ aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
+ KCmdLineArgs::init(argc, argv, &aboutData);
+
+ cliParser = std::make_shared<KCmdLineWrapper>();
+#elif defined HAVE_QT5
+ cliParser = std::make_shared<Qt5CliParser>();
+#else
+ cliParser = std::make_shared<CliParser>();
+#endif
+ Quassel::setCliParser(cliParser);
+
+ // Initialize CLI arguments
+ // NOTE: We can't use tr() at this point, since app is not yet created
+ // TODO: Change this once we get rid of KDE4 and can initialize the parser after creating the app
+
+ // put shared client&core arguments here
+ cliParser->addSwitch("debug", 'd', "Enable debug output");
+ cliParser->addSwitch("help", 'h', "Display this help and exit");
+ cliParser->addSwitch("version", 'v', "Display version information");
+#ifdef BUILD_QTUI
+ cliParser->addOption("configdir", 'c', "Specify the directory holding the client configuration", "path");
+#else
+ cliParser->addOption("configdir", 'c', "Specify the directory holding configuration files, the SQlite database and the SSL certificate", "path");
+#endif
+ cliParser->addOption("datadir", 0, "DEPRECATED - Use --configdir instead", "path");
+ cliParser->addOption("loglevel", 'L', "Loglevel Debug|Info|Warning|Error", "level", "Info");
+#ifdef HAVE_SYSLOG
+ cliParser->addSwitch("syslog", 0, "Log to syslog");