aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/main.cc')
-rw-r--r--src/nix-store/main.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index febe65e5c..1a9cbddbd 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -166,7 +166,6 @@ static void opSubstitute(Strings opFlags, Strings opArgs)
Substitute sub;
getline(cin, srcPath);
if (cin.eof()) break;
- getline(cin, sub.storeExpr);
getline(cin, sub.program);
string s;
getline(cin, s);
@@ -186,6 +185,17 @@ static void opSubstitute(Strings opFlags, Strings opArgs)
}
+static void opClearSubstitutes(Strings opFlags, Strings opArgs)
+{
+ if (!opFlags.empty()) throw UsageError("unknown flag");
+ if (!opArgs.empty())
+ throw UsageError("no arguments expected");
+
+ clearSubstitutes();
+}
+
+
+
static void opValidPath(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
@@ -354,6 +364,8 @@ void run(Strings args)
op = opSuccessor;
else if (arg == "--substitute")
op = opSubstitute;
+ else if (arg == "--clear-substitutes")
+ op = opClearSubstitutes;
else if (arg == "--validpath")
op = opValidPath;
else if (arg == "--isvalid")