From cc0999b70bcc08eca205f1a26dd676f6df35f62b Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Sun, 8 Jul 2018 13:05:09 +0900 Subject: [PATCH] Add section for resetting files --- README.md | 2 ++ nimgen.nim | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fbfff52..d2d04b8 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,8 @@ _[n.global]_ ```quotes``` = pick up any headers included using "" (and not <> which is typically used for standard headers) [default: true] +```reset``` = whether or not to reset all files after processing [default: false] + ```filter``` = string to identify and recurse into library .h files in #include statements and exclude standard headers ```cpp_compiler``` = string to specify a CPP compiler executable. [default: g++] diff --git a/nimgen.nim b/nimgen.nim index 61ad29d..5f3b1fb 100644 --- a/nimgen.nim +++ b/nimgen.nim @@ -9,6 +9,7 @@ var gConfig: Config gFilter = "" gQuotes = true + gReset = false gCppCompiler = "g++" gCCompiler = "gcc" gOutput = "" @@ -822,6 +823,10 @@ proc runCfg(cfg: string) = if gConfig["n.global"]["quotes"] == "false": gQuotes = false + if gConfig["n.global"].hasKey("reset"): + if gConfig["n.global"]["reset"] == "true": + gReset = true + if gConfig.hasKey("n.include"): for inc in gConfig["n.include"].keys(): gIncludes.add(inc.addEnv()) @@ -878,8 +883,9 @@ proc runCfg(cfg: string) = runFile(file, gConfig[file]) - # Reset files - gitReset() + if gReset: + # Reset files + gitReset() # ###