+ kiwix-index --backend argument in now option and set as "xapian" per defautl

pull/9/head
kelson42 16 years ago
parent fcb4ae81cd
commit 82c90efe98

@ -17,6 +17,7 @@ int main(int argc, char **argv) {
char *indexPath = NULL; char *indexPath = NULL;
bool verboseFlag = false; bool verboseFlag = false;
int option_index = 0; int option_index = 0;
int c = 0;
supportedBackend backend = XAPIAN; supportedBackend backend = XAPIAN;
kiwix::Indexer *indexer = NULL; kiwix::Indexer *indexer = NULL;
@ -30,9 +31,8 @@ int main(int argc, char **argv) {
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
int c = getopt_long(argc, argv, "vb:", long_options, &option_index);
if (c != -1) { if (c != -1) {
c = getopt_long(argc, argv, "vb:", long_options, &option_index);
switch (c) { switch (c) {
case 'v': case 'v':
@ -49,18 +49,19 @@ int main(int argc, char **argv) {
break; break;
} }
} else { } else {
if (argc > 2 && optind + option_index - 1 < argc) { if (optind < argc) {
if (zimFilePath == NULL) { if (zimFilePath == NULL) {
zimFilePath = argv[optind + option_index - 1]; zimFilePath = argv[optind++];
} else if (indexPath == NULL) { } else if (indexPath == NULL) {
indexPath = argv[optind + option_index - 1]; indexPath = argv[optind++];
} else { } else {
cout << zimFilePath << endl;
cout << indexPath << endl;
usage(); usage();
} }
} else { } else {
break; break;
} }
option_index++;
} }
} }

Loading…
Cancel
Save