summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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,