From 0e1dd54feef07fe0946b587aa34f5ef0cbddbb5d Mon Sep 17 00:00:00 2001 From: Andy Davidoff Date: Wed, 6 Nov 2019 14:40:22 -0500 Subject: [PATCH] add --clearNimblePath; fixes #12601 (#12609) (cherry picked from commit 738c957e94636d28e161bc37a440523e74758fae) --- compiler/commands.nim | 3 +++ compiler/options.nim | 3 +++ doc/advopt.txt | 1 + 3 files changed, 7 insertions(+) diff --git a/compiler/commands.nim b/compiler/commands.nim index 8d5452fa88..2044c1abde 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -380,6 +380,9 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; of "nonimblepath", "nobabelpath": expectNoArg(conf, switch, arg, pass, info) disableNimblePath(conf) + of "clearnimblepath": + expectNoArg(conf, switch, arg, pass, info) + clearNimblePath(conf) of "excludepath": expectArg(conf, switch, arg, pass, info) let path = processPath(conf, arg, info) diff --git a/compiler/options.nim b/compiler/options.nim index a997167601..38fbfdf155 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -544,6 +544,9 @@ proc disableNimblePath*(conf: ConfigRef) = incl conf.globalOptions, optNoNimblePath conf.lazyPaths.setLen(0) +proc clearNimblePath*(conf: ConfigRef) = + conf.lazyPaths.setLen(0) + include packagehandling proc getOsCacheDir(): string = diff --git a/doc/advopt.txt b/doc/advopt.txt index 6cf6157ec0..d1d4d46818 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -99,6 +99,7 @@ Advanced options: --putenv:key=value set an environment variable --NimblePath:PATH add a path for Nimble support --noNimblePath deactivate the Nimble path + --clearNimblePath empty the list of Nimble package search paths --noCppExceptions use default exception handling with C++ backend --cppCompileToNamespace:namespace use the provided namespace for the generated C++ code,