From 23b2ac039c090ed8e8264cdf53d2d394065e517f Mon Sep 17 00:00:00 2001 From: sebastien Date: Wed, 29 Oct 2008 15:19:56 +0000 Subject: [PATCH] trunk preprocessor: * added "notmpterms" to usage notice * fail when unknown option is given git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@2227 ac1d8469-bf42-47a9-8791-bf33cf982152 --- preprocessor/DynareMain.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/preprocessor/DynareMain.cc b/preprocessor/DynareMain.cc index da860a50b..832bd0d41 100644 --- a/preprocessor/DynareMain.cc +++ b/preprocessor/DynareMain.cc @@ -34,14 +34,20 @@ using namespace std; */ void main2(stringstream &in, string &basename, bool debug, bool clear_all, bool no_tmp_terms); +void +usage() +{ + cerr << "Dynare usage: dynare mod_file [debug] [noclearall] [savemacro] [notmpterms]" << endl; + exit(EXIT_FAILURE); +} + int main(int argc, char** argv) { if (argc < 2) { cerr << "Missing model file!" << endl; - cerr << "Dynare usage: dynare mod_file [debug] [noclearall] [savemacro]" << endl; - exit(-1); + usage(); } bool clear_all = true; @@ -60,6 +66,11 @@ main(int argc, char** argv) save_macro = true; else if (string(argv[arg]) == string("notmpterms")) no_tmp_terms = true; + else + { + cerr << "Unknown option: " << argv[arg] << endl; + usage(); + } } cout << "Starting Dynare ..." << endl