X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FArguments.cpp;h=9afe59a4ef6ddd397a591e6989775b704738b569;hb=eb2ad5ffd08128d31af32f3929a3295fcfa251e9;hp=bdfdf181579c17d934125cbc5b84c3f4c2706c12;hpb=7830acc2ab78d0c82a72948c4eb87eeb6463693c;p=l2e.git diff --git a/src/app/Arguments.cpp b/src/app/Arguments.cpp index bdfdf18..9afe59a 100644 --- a/src/app/Arguments.cpp +++ b/src/app/Arguments.cpp @@ -1,10 +1,3 @@ -/* - * Arguments.cpp - * - * Created on: Sep 15, 2012 - * Author: holy - */ - #include "Arguments.h" #include @@ -13,7 +6,8 @@ namespace app { Arguments::Arguments() -: outfile(0) { +: outfile(0) +, runlevel(PLAY) { } @@ -23,12 +17,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]);