diff --git a/src/main.c b/src/main.c index 392f03b..a652ce8 100644 --- a/src/main.c +++ b/src/main.c @@ -234,7 +234,14 @@ main (int argc, char **argv) /* memory clean up? */ strings_cleanup (); - return exitcode; + if (switches.exitCodes) + { + return exitcode; + } + else + { + return 0; + } } //! Analyse the model diff --git a/src/switches.c b/src/switches.c index 756f8e8..4bf1aaf 100644 --- a/src/switches.c +++ b/src/switches.c @@ -108,6 +108,7 @@ switchesInit (int argc, char **argv) switches.monochrome = false; // default colors for dot switches.lightness = 0; // lightness correction switches.clusters = false; // default is no clusters for now + switches.exitCodes = true; // default is to flag exit codes // Process the environment variable SCYTHERFLAGS 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 diff --git a/src/switches.h b/src/switches.h index b344787..c2d8a65 100644 --- a/src/switches.h +++ b/src/switches.h @@ -83,7 +83,8 @@ struct switchdata int plain; //!< Disable color output on terminal int monochrome; //!< Disable colors in dot output 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