]> git.localhorst.tv Git - l2e.git/blobdiff - src/app/Arguments.cpp
better handling of nested state changes
[l2e.git] / src / app / Arguments.cpp
index bdfdf181579c17d934125cbc5b84c3f4c2706c12..fa8c851e35ad1990051b9d2c1852a9b7c7f00268 100644 (file)
@@ -13,7 +13,8 @@
 namespace app {
 
 Arguments::Arguments()
-: outfile(0) {
+: outfile(0)
+, runlevel(PLAY) {
 
 }
 
@@ -23,12 +24,25 @@ void Arguments::Read(int argc, char **argv) {
                char *arg(argv[i]);
                if (arg[0] == '-') {
                        switch (arg[1]) {
+                               case 'd':
+                                       runlevel = DUMP;
+                                       break;
                                case 'o':
                                        if (i + 1 >= argc) {
                                                throw std::runtime_error("missing argument to -o");
                                        }
                                        ++i;
                                        outfile = argv[i];
+                                       runlevel = WRITE;
+                                       break;
+                               case 'B':
+                                       runlevel = BATTLE;
+                                       break;
+                               case 'M':
+                                       runlevel = MAP;
+                                       break;
+                               case 'S':
+                                       runlevel = SOURCE_WIKI;
                                        break;
                                default:
                                        throw std::runtime_error(std::string("unknown option ") + arg[1]);