diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-06-23 14:40:49 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-06-23 14:40:49 +0000 |
commit | 692b562342ac7ead43ef06497f6a8b4b6e724ae5 (patch) | |
tree | 4cd87673fff6af4c6c5501b274bfc1023246aaba /src/nix.cc | |
parent | c0cbaef4bece0c2447828739dd9622c329948064 (diff) |
* `nix --delete' command.
Diffstat (limited to 'src/nix.cc')
-rw-r--r-- | src/nix.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nix.cc b/src/nix.cc index bd3565810..9b21f0379 100644 --- a/src/nix.cc +++ b/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); + } } |