1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 08:11:47 +02:00

* `nix --delete' command.

This commit is contained in:
Eelco Dolstra 2003-06-23 14:40:49 +00:00
parent c0cbaef4be
commit 692b562342
6 changed files with 66 additions and 2 deletions

View file

@ -112,8 +112,20 @@ static void opEvaluate(Strings opFlags, Strings opArgs)
static void opDelete(Strings opFlags, Strings opArgs)
{
getArgType(opFlags);
if (!opFlags.empty()) throw UsageError("unknown flag");
cerr << "delete!\n";
for (Strings::iterator it = opArgs.begin();
it != opArgs.end(); it++)
{
Hash hash;
if (argType == atpHash)
hash = parseHash(*it);
else if (argType == atpName)
throw Error("not implemented");
else
throw Error("invalid argument type");
deleteValue(hash);
}
}