From 03e1eadba620db44b82dcd8f1f2d6b514906fa2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 15 May 2007 16:51:39 +0000 Subject: [PATCH] Test: Added command line option "--debug" that is used by the tests "internaltesting" --- main.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/main.cpp b/main.cpp index d845dfb18..5f2f11e89 100644 --- a/main.cpp +++ b/main.cpp @@ -11,6 +11,7 @@ //--------------------------------------------------------------------------- std::vector Files; +static bool Debug = false; //--------------------------------------------------------------------------- struct TOKEN { @@ -61,7 +62,9 @@ static void CppCheck(const char FileName[]); int main(int argc, char* argv[]) { - if (argc != 2) + Debug = (argc == 3 && strcmp(argv[1], "--debug")==0); + + if (argc == 1 || argc > 3) { std::cout << "Syntax:\n checkcode filename\n"; return 0; @@ -659,14 +662,8 @@ void CreateStatementList() } } -/* - char fname[1000]; - strcpy(fname, Files[0].c_str()); - if (strchr(fname,'.')) + if (Debug) { - strcpy(strrchr(fname,'.'), ".s"); - std::ofstream f(fname); -*/ std::list::const_iterator it; for (it = Statements.begin(); it != Statements.end(); it++) { @@ -706,9 +703,9 @@ void CreateStatementList() break; - }; + } } -// } + } } //---------------------------------------------------------------------------