mirror of
https://github.com/NixOS/nix
synced 2025-07-05 08:11:47 +02:00
* `nix --delete' command.
This commit is contained in:
parent
c0cbaef4be
commit
692b562342
6 changed files with 66 additions and 2 deletions
14
src/nix.cc
14
src/nix.cc
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue