add definition of verbose
[ecparse.git] / Main.cpp
1 /**
2  * © 2008 by David Roden <droden@gmail.com>
3  */
4
5 #include <string.h>
6 #include "Main.h"
7
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");
11 }
12
13 int main(int argc, char** argv) {
14         FileReaderInput* fileReaderInput;
15         CollectionReader* collectionReader;
16         char* currentArgument;
17         char* fileToOpen = NULL;
18         int argumentIndex;
19
20         for (argumentIndex = 1; argumentIndex < argc; argumentIndex++) {
21                 currentArgument = argv[argumentIndex];
22                 if (!strcmp("--help", currentArgument) || !strcmp("-h", currentArgument)) {
23                         printSyntaxHelp();
24                 } else if (!strcmp("--verbose", currentArgument) || !strcmp("-v", currentArgument)) {
25                         GlobalSettings::setVerbose(true);
26                 } else if (!strcmp("--file", currentArgument) || !strcmp("-f", currentArgument)) {
27                         fileToOpen = currentArgument;
28                 } else {
29                         printf("Unknown Parameter: %s\n", currentArgument);
30                         return 1;
31                 }
32         }
33
34         return 0;
35 }
36