projects
/
ecparse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2af3846
)
read all links and print them
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sat, 5 Jul 2008 17:21:40 +0000
(19:21 +0200)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Sat, 5 Jul 2008 17:21:40 +0000
(19:21 +0200)
Main.cpp
patch
|
blob
|
history
diff --git
a/Main.cpp
b/Main.cpp
index
6b5f39f
..
8466ad8
100644
(file)
--- a/
Main.cpp
+++ b/
Main.cpp
@@
-15,7
+15,9
@@
int main(int argc, char** argv) {
CollectionReader* collectionReader;
char* currentArgument;
char* fileToOpen = NULL;
CollectionReader* collectionReader;
char* currentArgument;
char* fileToOpen = NULL;
+ FILE* file = NULL;
int argumentIndex;
int argumentIndex;
+ ED2KLink* nextLink = NULL;
for (argumentIndex = 1; argumentIndex < argc; argumentIndex++) {
currentArgument = argv[argumentIndex];
for (argumentIndex = 1; argumentIndex < argc; argumentIndex++) {
currentArgument = argv[argumentIndex];
@@
-24,13
+26,29
@@
int main(int argc, char** argv) {
} else if (!strcmp("--verbose", currentArgument) || !strcmp("-v", currentArgument)) {
GlobalSettings::setVerbose(true);
} else if (!strcmp("--file", currentArgument) || !strcmp("-f", currentArgument)) {
} else if (!strcmp("--verbose", currentArgument) || !strcmp("-v", currentArgument)) {
GlobalSettings::setVerbose(true);
} else if (!strcmp("--file", currentArgument) || !strcmp("-f", currentArgument)) {
- fileToOpen =
currentArgument
;
+ fileToOpen =
argv[++argumentIndex]
;
} else {
printf("Unknown Parameter: %s\n", currentArgument);
return 1;
}
}
} else {
printf("Unknown Parameter: %s\n", currentArgument);
return 1;
}
}
+ if (fileToOpen) {
+ file = fopen(fileToOpen, "r");
+ fileReaderInput = new FileReaderInput(file);
+ } else {
+ fileReaderInput = new FileReaderInput(stdin);
+ }
+
+ collectionReader = new CollectionReader(fileReaderInput);
+ while ((nextLink = collectionReader->getNextLink())) {
+ printf("%s\n", nextLink->getLink());
+ }
+
+ if (file) {
+ fclose(file);
+ }
+
return 0;
}
return 0;
}