From 474a2f819c2f7c5216cba5f33fcbc36d9b6886d1 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 27 Mar 2015 09:15:10 +0200 Subject: [PATCH] Use add_argument instead of get_args --- source/engineer/options.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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"; } -- 2.45.2