X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Foptions.cpp;h=b5c36cd5409cca9e43822fda7215e9f1e9018b52;hb=a72309e64614bb1e230f9842d94dc261be1301e6;hp=9861c10e7e6230f282f8f1f4aaa6159c0e3d76c5;hpb=651698847d5293cfb15b6fb23a394701388c0151;p=r2c2.git diff --git a/source/engineer/options.cpp b/source/engineer/options.cpp index 9861c10..b5c36cd 100644 --- a/source/engineer/options.cpp +++ b/source/engineer/options.cpp @@ -1,11 +1,12 @@ /* $Id$ -This file is part of the MSP Märklin suite +This file is part of R²C² Copyright © 2010 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ #include +#include #include #include #include "options.h" @@ -30,6 +31,7 @@ Options::Options(int argc, char **argv): getopt.add_option('d', "driver", driver, GetOpt::REQUIRED_ARG); getopt.add_option('s', "simulate", simulate, GetOpt::NO_ARG); getopt.add_option('n', "network", network, GetOpt::NO_ARG); + getopt.add_option( "state", state_fn, GetOpt::REQUIRED_ARG); getopt(argc, argv); if(!res.empty()) @@ -48,4 +50,7 @@ Options::Options(int argc, char **argv): throw UsageError("No layout given"); layout_fn = args[0]; + + if(state_fn.empty()) + state_fn = FS::basepart(layout_fn)+".state"; }