/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <cstdlib>
-#ifdef HAVE_KDE
-# include <KCmdLineArgs>
-# include <KAboutData>
-#endif
-
#ifdef BUILD_CORE
# include "coreapplication.h"
#elif defined BUILD_QTUI
#error "Something is wrong - you need to #define a build mode!"
#endif
+// We don't want quasselcore to depend on KDE
+#if defined HAVE_KDE && defined BUILD_CORE
+# undef HAVE_KDE
+#endif
+
+#ifdef HAVE_KDE
+# include <KAboutData>
+# include "kcmdlinewrapper.h"
+#endif
+
+#include "cliparser.h"
#include "quassel.h"
int main(int argc, char **argv) {
QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName);
QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain);
+ AbstractCliParser *cliParser;
+
#ifdef HAVE_KDE
// We need to init KCmdLineArgs first
// TODO: build an AboutData compat class to replace our aboutDlg strings
aboutData.addLicense(KAboutData::License_GPL_V3);
aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
KCmdLineArgs::init(argc, argv, &aboutData);
+
+ cliParser = new KCmdLineWrapper();
+#else
+ cliParser = new CliParser();
#endif
+ Quassel::setCliParser(cliParser);
// Initialize CLI arguments
// NOTE: We can't use tr() at this point, since app is not yet created
- CliParser *cliParser = Quassel::cliParser();
// put shared client&core arguments here
cliParser->addSwitch("debug",'d', "Enable debug output");
#endif
#ifndef BUILD_QTCLIENT
// put core-only arguments here
+ cliParser->addOption("listen <address>[,<address[,...]]>", 0, "The address(es) quasselcore will listen on", "0.0.0.0,::");
cliParser->addOption("port <port>",'p', "The port quasselcore will listen at", QString("4242"));
cliParser->addSwitch("norestore", 'n', "Don't restore last core's state");
cliParser->addOption("logfile <path>", 'l', "Path to logfile");