summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndy Davidoff <disruptek@users.noreply.github.com>2019-11-06 14:40:22 -0500
committerAndreas Rumpf <rumpf_a@web.de>2019-11-06 20:40:22 +0100
commit738c957e94636d28e161bc37a440523e74758fae (patch)
tree12ecfe05c020d45569df83ee94d21938749d5aa3
parent717da9f158c4ea7f7d24680a2a349d2260bd546e (diff)
downloadNim-738c957e94636d28e161bc37a440523e74758fae.tar.gz
add --clearNimblePath; fixes #12601 (#12609)
-rw-r--r--compiler/commands.nim3
-rw-r--r--compiler/options.nim3
-rw-r--r--doc/advopt.txt1
3 files changed, 7 insertions, 0 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index c69dd3226..12526e6c7 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -381,6 +381,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 564eef6ab..50bae9557 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -546,6 +546,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 351815ade..5209a0737 100644
--- a/doc/advopt.txt
+++ b/doc/advopt.txt
@@ -102,6 +102,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,