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.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index a3c1b8fa7..a124543fb 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -420,7 +420,17 @@ static void opInit(Strings opFlags, Strings opArgs)
/* Verify the consistency of the Nix environment. */
static void opVerify(Strings opFlags, Strings opArgs)
{
- verifyStore();
+ if (!opArgs.empty())
+ throw UsageError("no arguments expected");
+
+ bool checkContents = false;
+
+ for (Strings::iterator i = opFlags.begin();
+ i != opFlags.end(); ++i)
+ if (*i == "--check-contents") checkContents = true;
+ else throw UsageError(format("unknown flag `%1%'") % *i);
+
+ verifyStore(checkContents);
}