From: Arnaud Giersch Date: Tue, 15 Mar 2011 14:14:30 +0000 (+0100) Subject: Add debugging option -x. X-Git-Tag: v0.1~79 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/0ceae49534d276cb5a76a390cfb802fc9a60aea3?ds=sidebyside Add debugging option -x. --- diff --git a/options.cpp b/options.cpp index 3ec77d4..f8d6eea 100644 --- a/options.cpp +++ b/options.cpp @@ -33,6 +33,7 @@ namespace opt { std::string program_name; int help_requested = 0; bool version_requested = false; + int option_x = 0; // hidden option, for debugging purpose // Simulation parameters int log_rate = 1; @@ -214,7 +215,7 @@ bool opt::parse_args(int* argc, char* argv[]) int c; opterr = 0; while ((c = getopt(*argc, argv, - "a:bc:C:d:D:ehi:I:l:L:m:M:N:r:Rs:S:t:T:vV")) != -1) { + "a:bc:C:d:D:ehi:I:l:L:m:M:N:r:Rs:S:t:T:vVx:")) != -1) { switch (c) { case 'a': opt::loba_algo = optarg; @@ -306,6 +307,10 @@ bool opt::parse_args(int* argc, char* argv[]) case 'V': opt::version_requested = true; break; + case 'x': + PARSE_ARG(opt::option_x); + XBT_WARN("option_x set to %d", opt::option_x); + break; case '?': XBT_ERROR("invalid option -- '%c'", optopt); result = false; diff --git a/options.h b/options.h index dee2953..604d178 100644 --- a/options.h +++ b/options.h @@ -19,6 +19,7 @@ namespace opt { extern std::string program_name; extern int help_requested; extern bool version_requested; + extern int option_x; // hidden option, for debugging purpose // Simulation parameters extern int log_rate;