From: Mikko Rasa Date: Fri, 27 Mar 2015 07:15:10 +0000 (+0200) Subject: Use add_argument instead of get_args X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=474a2f819c2f7c5216cba5f33fcbc36d9b6886d1;p=r2c2.git Use add_argument instead of get_args --- diff --git a/source/engineer/options.cpp b/source/engineer/options.cpp index bdac361..7eabb8e 100644 --- a/source/engineer/options.cpp +++ b/source/engineer/options.cpp @@ -27,6 +27,7 @@ Options::Options(int argc, char **argv): getopt.add_option( "sim-speed", sim_speed, GetOpt::REQUIRED_ARG); getopt.add_option('n', "network", network, GetOpt::NO_ARG); getopt.add_option( "state", state_fn, GetOpt::REQUIRED_ARG); + getopt.add_argument("layout", layout_fn, GetOpt::REQUIRED_ARG); getopt(argc, argv); if(!res.empty()) @@ -40,12 +41,6 @@ Options::Options(int argc, char **argv): throw usage_error("Invalid resolution"); } - const vector &args = getopt.get_args(); - if(args.empty()) - throw usage_error("No layout given"); - - layout_fn = args[0]; - if(state_fn.empty()) state_fn = FS::basepart(layout_fn)+".state"; }