Instead of unconditionally erasing the whole target, add support for using the common --erase flag. Signed-off-by: Peter Johanson <peter@peterjohanson.com>