From 42e5efedac7276713f19f754674210455907c8dd Mon Sep 17 00:00:00 2001 From: ccremers Date: Wed, 28 Jul 2004 12:22:40 +0000 Subject: [PATCH] - When counting scenarios, the exit code reflects the number of scenarios. --- src/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.c b/src/main.c index e705d1e..7e65624 100644 --- a/src/main.c +++ b/src/main.c @@ -19,10 +19,15 @@ * \section exit Exit codes * * 0 Okay No attack found, claims encountered + * * 1 Error Something went wrong (error) E.g. switch error, or scenario ran out. + * * 2 Okay No attack found (because) no claims encountered + * * 3 Okay Attack found * + * However, if the --scenario=-1 switch is used, the exit code is used to return the number of scenarios. + * * \section coding Coding conventions * * Usually, each source file except main.c has an myfileInit() and myfileDone() function @@ -462,6 +467,12 @@ main (int argc, char **argv) if (sys->latex) latexDone (sys); + /* transfer any scenario counting to the exit code */ + if (sys->switchScenario < 0) + { + exitcode = sys->countScenario; + } + /* * Now we clean up any memory that was allocated. */