Closed spiffytech closed 8 years ago
/va
appears to be a valid argument to reg delete:
/va delete all values under this key.
What were you trying to do that this was causing a problem?
/va
deletes the contents of the key, but leaves the key itself in place. This does not match the stated behavior of erase
in the README, which claims erase
deletes a key.
Further, without this patch, it's not clear that winreg can delete a key at all (i.e., it's unclear if remove
can substitute for the patched [stated] behavior of erase
).
I'm trying to pass winreg a path and have that registry entry and all of its children nuked.
So without /va
if a key has values the key and all of the values are deleted? Sounds :+1: to me then.
I think /VA only deletes the values. Should we use an additional method to delete keys and just update the docs for erase? I don't want to break the behaviour of this method in case it leads to problems with existing programs that depend on that behaviour.
It's also already implemented in the tests-docs branch. https://github.com/fresc81/node-winreg/blob/tests-docs/lib/registry.js#L663
Can this be merged? I need this behavior in my program.
You don't need to worry about breaking existing code. That's what semantic versioning is for. Release it as version 2.0.0.
I just sent a fresh PR that merges cleanly to fix this. Just tested it and it works perfectly :dizzy: