From af08d169d893d86634a320f5ecdf73915b31f220 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 10 Aug 2019 20:47:50 +0200 Subject: [PATCH] more featured -debf option --- commandline.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/commandline.cpp b/commandline.cpp index 670c9ce9..4f2cd0f2 100644 --- a/commandline.cpp +++ b/commandline.cpp @@ -149,7 +149,30 @@ int arg::readCommon() { for(char c: s) { for(int i=0; i= '0' && c <= '9') { + debugflags &= DF_TIME; + if(c >= '1') + debugflags |= DF_INIT | DF_WARN | DF_MSG | DF_ERROR; + if(c >= '2') + debugflags |= DF_GEOM | DF_GP | DF_LOG | DF_FIELD | DF_POLY; + if(c >= '3') + debugflags |= DF_TURN | DF_STEAM; + if(c >= '4') + debugflags |= DF_GRAPH | DF_MEMORY; + } + else if(c == '+') { + if(debugfile) fclose(debugfile); + shift(); + println(hlog, "writing to ", argcs()); + debugfile = fopen(argcs(), "at"); + } + else if(c == '@') { + if(debugfile) fclose(debugfile); + shift(); + println(hlog, "writing to ", argcs()); + debugfile = fopen(argcs(), "wt"); } } }