2 * © 2008 by David Roden <droden@gmail.com>
8 void printSyntaxHelp() {
9 printf("ecparse %s - © 2008 by David ‘Bombe’ Roden <bombe@pterodactylus.net\n", VERSION);
10 printf("ecparse [ -v | --verbose ] [ { -f | --file } <file> ]\n");
13 int main(int argc, char** argv) {
14 FileReaderInput* fileReaderInput;
15 CollectionReader* collectionReader;
16 char* currentArgument;
17 char* fileToOpen = NULL;
20 ED2KLink* nextLink = NULL;
22 for (argumentIndex = 1; argumentIndex < argc; argumentIndex++) {
23 currentArgument = argv[argumentIndex];
24 if (!strcmp("--help", currentArgument) || !strcmp("-h", currentArgument)) {
26 } else if (!strcmp("--verbose", currentArgument) || !strcmp("-v", currentArgument)) {
27 GlobalSettings::setVerbose(true);
28 } else if (!strcmp("--file", currentArgument) || !strcmp("-f", currentArgument)) {
29 fileToOpen = argv[++argumentIndex];
31 printf("Unknown Parameter: %s\n", currentArgument);
37 file = fopen(fileToOpen, "r");
38 fileReaderInput = new FileReaderInput(file);
40 fileReaderInput = new FileReaderInput(stdin);
43 collectionReader = new CollectionReader(fileReaderInput);
44 while ((nextLink = collectionReader->getNextLink())) {
45 printf("%s\n", nextLink->getLink());