aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 23863525f..82e08fecf 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -746,18 +746,12 @@ static void showOptimiseStats(OptimiseStats & stats)
files with the same contents. */
static void opOptimise(Strings opFlags, Strings opArgs)
{
- if (!opArgs.empty())
+ if (!opArgs.empty() || !opFlags.empty())
throw UsageError("no arguments expected");
- bool dryRun = false;
-
- foreach (Strings::iterator, i, opFlags)
- if (*i == "--dry-run") dryRun = true;
- else throw UsageError(format("unknown flag `%1%'") % *i);
-
OptimiseStats stats;
try {
- ensureLocalStore().optimiseStore(dryRun, stats);
+ ensureLocalStore().optimiseStore(stats);
} catch (...) {
showOptimiseStats(stats);
throw;