+ stub of kiwix-manage

This commit is contained in:
kelson42 2011-04-15 17:16:27 +00:00
parent 7f00e1a9b1
commit 8191b3ebc0

View File

@ -22,6 +22,40 @@
using namespace std; using namespace std;
enum supportedAction { NONE, ADD, SHOW, REMOVE };
int main(int argc, char **argv) { int main(int argc, char **argv) {
string libraryPath = "";
supportedAction action = NONE;
string zimPath = "";
/* Argument parsing */
if (argc > 2) {
libraryPath = argv[1];
string actionString = argv[2];
if (actionString == "add")
action = ADD;
else if (actionString == "show")
action = SHOW;
else if (actionString == "remove" || actionString == "delete")
action = REMOVE;
}
/* Print usage)) if necessary */
if (libraryPath == "" || action == NONE) {
cerr << "Usage: kiwix-manage LIBRARY_PATH ACTION [OPTIONS]" << endl;
exit(1);
}
/* SHOW */
if (action == SHOW) {
} else if (action == ADD) {
std::cerr << "ADD is still not implemented." << std::endl;
} else if (action == REMOVE) {
std::cerr << "REMOVE is still not implemented." << std::endl;
}
exit(0); exit(0);
} }