mirror of
https://github.com/NixOS/nix
synced 2025-07-03 06:11:46 +02:00
nix-store --gc --max-freed: Support a unit specifier
E.g. "--max-freed 10G" means "free ten gigabytes".
This commit is contained in:
parent
00d30496ca
commit
1da6ae4f99
3 changed files with 25 additions and 6 deletions
|
@ -619,7 +619,7 @@ 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") {
|
||||
long long maxFreed = getIntArg<long long>(*i, i, opFlags.end());
|
||||
long long maxFreed = getIntArg<long long>(*i, i, opFlags.end(), true);
|
||||
options.maxFreed = maxFreed >= 0 ? maxFreed : 0;
|
||||
}
|
||||
else throw UsageError(format("bad sub-operation `%1%' in GC") % *i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue