Added switch to disable verbose exit codes.

In the near future, the default exit code behavior should be made obsolete anyway,
as the exit codes are not a nice way to report status.
It used to be convenient for shell scripting in early times,
when the parallel tests were run using the forward model
checker, but no modern script should be relying on it.
This commit is contained in:
Cas Cremers 2008-06-16 18:57:28 +02:00
parent c729d13a00
commit a0a377a84f
3 changed files with 27 additions and 2 deletions

View File

@ -234,7 +234,14 @@ main (int argc, char **argv)
/* memory clean up? */ /* memory clean up? */
strings_cleanup (); strings_cleanup ();
return exitcode; if (switches.exitCodes)
{
return exitcode;
}
else
{
return 0;
}
} }
//! Analyse the model //! Analyse the model

View File

@ -108,6 +108,7 @@ switchesInit (int argc, char **argv)
switches.monochrome = false; // default colors for dot switches.monochrome = false; // default colors for dot
switches.lightness = 0; // lightness correction switches.lightness = 0; // lightness correction
switches.clusters = false; // default is no clusters for now switches.clusters = false; // default is no clusters for now
switches.exitCodes = true; // default is to flag exit codes
// Process the environment variable SCYTHERFLAGS // Process the environment variable SCYTHERFLAGS
process_environment (); process_environment ();
@ -900,6 +901,22 @@ switcher (const int process, int index, int commandline)
} }
} }
if (detect (' ', "no-exitcodes", 0))
{
if (!process)
{
if (switches.expert)
{
helptext (" --no-exitcodes", "Disable verbose exitcodes.");
}
}
else
{
switches.exitCodes = false;
return index;
}
}
/* ================== /* ==================
* Modelchecker only * Modelchecker only

View File

@ -83,7 +83,8 @@ struct switchdata
int plain; //!< Disable color output on terminal int plain; //!< Disable color output on terminal
int monochrome; //!< Disable colors in dot output int monochrome; //!< Disable colors in dot output
int lightness; //!< Lightness increment 0-100 int lightness; //!< Lightness increment 0-100
int clusters; //!> Enable clusters in output int clusters; //!< Enable clusters in output
int exitCodes; //!< Enable verbose exit codes
}; };
extern struct switchdata switches; //!< pointer to switchdata structure extern struct switchdata switches; //!< pointer to switchdata structure