diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-11-24 12:26:25 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-11-24 12:26:25 +0000 |
commit | 9b8fda796b620a5476e8a50edcc29a3462667fc3 (patch) | |
tree | fa546a5b5a0b08c01a7bdc9ee50e69d7bfd87165 /src/nix-store/nix-store.cc | |
parent | 80220155523fb21c938d595e96597f6511aa7bd0 (diff) |
* Templatise getIntArg / string2Int.
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r-- | src/nix-store/nix-store.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index e08908cd7..b873baacb 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -532,10 +532,10 @@ static void opGC(Strings opFlags, Strings opArgs) else if (*i == "--print-dead") options.action = GCOptions::gcReturnDead; else if (*i == "--delete") options.action = GCOptions::gcDeleteDead; else if (*i == "--max-freed") { - options.maxFreed = getIntArg(*i, i, opFlags.end()); - if (options.maxFreed == 0) options.maxFreed = 1; + long long maxFreed = getIntArg<long long>(*i, i, opFlags.end()); + options.maxFreed = maxFreed >= 1 ? maxFreed : 1; } - else if (*i == "--max-links") options.maxLinks = getIntArg(*i, i, opFlags.end()); + else if (*i == "--max-links") options.maxLinks = getIntArg<unsigned int>(*i, i, opFlags.end()); else throw UsageError(format("bad sub-operation `%1%' in GC") % *i); if (!opArgs.empty()) throw UsageError("no arguments expected"); |