Commit 556eb1f4 authored by Lukas Appelhans's avatar Lukas Appelhans

Moar moar

parent 24519792
......@@ -27,9 +27,18 @@ int main(int argc, char** argv)
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
options.add("D", ki18n("Database operation"));
options.add("Q", ki18n("Query operation"));
options.add("R", ki18n("Remove operation"));
options.add("S", ki18n("Sync operation"));
options.add("y", ki18n("Refresh database"));
options.add("u", ki18n("Update system"));
options.add("U", ki18n("Upgrade operation"));
KCmdLineArgs::addCmdLineOptions(options);
......@@ -42,29 +51,34 @@ int main(int argc, char** argv)
}
KUniqueApplication app;
//kError() << "asd";
//kDebug() << "blub";
printf("bla\n");
//fprintf(stdout, "asdsad\n");
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QList<APM::Operation> list;
APM::OperationType type = APM::NoType;
if (args->isSet("S")) {
if (args->isSet("D")) {
type = APM::DatabaseOperation;
} else if (args->isSet("Q")) {
type = APM::QueryOperation;
} else if (args->isSet("R")) {
type = APM::RemoveOperation;
} else if (args->isSet("S")) {
type = APM::SyncOperation;
if (args->isSet("y"))
list.append(APM::UpdateDatabases);
if (args->isSet("y"))
if (args->isSet("u"))
list.append(APM::UpdateSystem);
} else if (args->isSet("U")) {
type = APM::UpgradeOperation;
} else {
fprintf(stderr, "Please select an operation to do!\nCall akabei --help for explanation.\n");
return app.exec();
}
QStringList rest;
for (int i = 0; i < args->count(); i++)
{
for (int i = 0; i < args->count(); i++) {
rest << args->arg(i);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment