Commit 325b52cc authored by Lukas Appelhans's avatar Lukas Appelhans

Looks much much better

parent c40fa3d7
......@@ -63,8 +63,12 @@ public:
DatabaseOnly,//Also in upgrade
RemoveConfig,
Recursive,
Unneeded
Unneeded,
///Upgrade operation makes only use of operations specified above
///Random
RootDir,
CacheDir,
DBPath
};
explicit APM(OperationType type, QList<Operation> operations, QMultiHash<Operation, QString> options, QStringList args, QObject* parent = 0);
virtual ~APM();
......
......@@ -28,49 +28,85 @@ int main(int argc, char** argv)
KCmdLineArgs::init(argc, argv, &aboutData);
KCmdLineOptions options;
options.add("r");
options.add("root <path>", ki18n("Set a different root dir"));
options.add("b");
options.add("dbpath <path>", ki18n("Set a different database dir"));
options.add("cachedir <path>", ki18n("Set a different cache dir"));
options.add("D", ki18n("Database operation"));
//FIXME: For example with owsn we should use "owns <File>", this needs different parsing later as we need to use getOption
options.add("Q", ki18n("Query operation"));
options.add("c", ki18n("Shows changelog of the package"));
options.add("d", ki18n("Shows packages which got installed as dependencies"));
options.add("e", ki18n("Shows packages which got installed explicitely"));
options.add("g", ki18n("Shows all packages in a package group"));
options.add("i", ki18n("Shows package information"));
options.add("k", ki18n("Check if the files of the package are available"));
options.add("m", ki18n("Shows packages which were not found in the Sync-db(s)"));
options.add("o", ki18n("Returns the package which contains the file"));
options.add("p", ki18n("Queries a package file instead of the database"));
options.add("s", ki18n("Searches locally installed packages"));
options.add("t", ki18n("Returns packages who are not required by others"));
options.add("u", ki18n("Returns upgradable packages"));
options.add("q", ki18n("Shows less information in queries and searches"));
options.add("c");
options.add("changelog", ki18n("Shows changelog of the package"));
options.add("d");
options.add("deps", ki18n("Shows packages which got installed as dependencies"));
options.add("e");
options.add("explicit", ki18n("Shows packages which got installed explicitely"));
options.add("g");
options.add("groups", ki18n("Shows all packages in a package group"));
options.add("i");
options.add("info", ki18n("Shows package information"));
options.add("k");
options.add("check", ki18n("Check if the files of the package are available"));
options.add("m");
options.add("foreign", ki18n("Shows packages which were not found in the Sync-db(s)"));
options.add("o");
options.add("owns", ki18n("Returns the package which contains the file"));
options.add("p");
options.add("file", ki18n("Queries a package file instead of the database"));
options.add("s");
options.add("search", ki18n("Searches locally installed packages"));
options.add("t");
options.add("unrequired", ki18n("Returns packages who are not required by others"));
options.add("u");
options.add("upgrades", ki18n("Returns upgradable packages"));
options.add("q");
options.add("quiet", ki18n("Shows less information in queries and searches"));
options.add("R", ki18n("Remove operation"));
options.add("c", ki18n("Removes all packages and those depending on them"));
options.add("d", ki18n("Skip dependency check"));
options.add("k", ki18n("Only remove database entries"));
options.add("n", ki18n("Also remove configuration files"));
options.add("s", ki18n("Remove dependencies as well. (-ss includes explicitely installed dependencies"));
options.add("u", ki18n("Removes not used packages"));
options.add("c");
options.add("cascade", ki18n("Removes all packages and those depending on them"));
options.add("d");
options.add("nodeps", ki18n("Skip dependency check"));
options.add("k");
options.add("dbonly", ki18n("Only remove database entries"));
options.add("n");
options.add("nosave", ki18n("Also remove configuration files"));
options.add("s");
options.add("recursive", ki18n("Remove dependencies as well. (-ss includes explicitely installed dependencies"));
options.add("u");
options.add("unneeded", ki18n("Removes not used packages"));
options.add("S", ki18n("Sync operation"));
options.add("asdeps", ki18n("Install all packages as non-explicit"));
options.add("asexplicit", ki18n("Install all packages as explicit"));
options.add("c", ki18n("Remove old packages from cache"));
options.add("c");
options.add("clean", ki18n("Remove old packages from cache"));
options.add("cc", ki18n("Remove all packages from cache"));
options.add("d", ki18n("Skip dependency check"));
options.add("f", ki18n("Force installation. Overwrite file conflicts"));
options.add("g", ki18n("Show all packages in a group"));
options.add("i", ki18n("Show package information"));
options.add("l", ki18n("List all packages of a specific repository"));
options.add("s", ki18n("Searches repositories for a word"));
options.add("w", ki18n("Downloads packages without installing or upgrading them"));
options.add("d");
options.add("nodeps", ki18n("Skip dependency check"));
options.add("f");
options.add("force", ki18n("Force installation. Overwrite file conflicts"));
options.add("g");
options.add("groups", ki18n("Show all packages in a group"));
options.add("i");
options.add("info", ki18n("Show package information"));
options.add("l");
options.add("list", ki18n("List all packages of a specific repository"));
options.add("s");
options.add("search", ki18n("Searches repositories for a word"));
options.add("w");
options.add("downloadonly", ki18n("Downloads packages without installing or upgrading them"));
options.add("needed", ki18n("Up-to-date packages are not reinstalled"));
options.add("ignore <package>", ki18n("Ignores a certain package. Can be used more than once."));
options.add("ignoregroup <group>", ki18n("Ignores upgrade of a group"));
options.add("y", ki18n("Refresh database"));
options.add("u", ki18n("Update system"));
options.add("y");
options.add("refresh", ki18n("Refresh database"));
options.add("u");
options.add("sysupgrade", ki18n("Update system"));
options.add("U", ki18n("Upgrade operation"));
......@@ -185,6 +221,17 @@ int main(int argc, char** argv)
fprintf(stderr, "Please select an operation to do!\nCall akabei --help for explanation.\n");
return app.exec();
}
QString root = args->getOption("r");
if (!root.isEmpty())
opts.insert(APM::RootDir, root);
QString dbs = args->getOption("b");
if (!dbs.isEmpty())
opts.insert(APM::DBPath, dbs);
QString cache = args->getOption("cachedir");
if (!cache.isEmpty())
opts.insert(APM::CacheDir, cache);
QStringList rest;
......
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