zachjs / sv2v

SystemVerilog to Verilog conversion
BSD 3-Clause "New" or "Revised" License
498 stars 50 forks source link

Add option to overwrite existing output file #197

Closed hughperkins closed 2 years ago

hughperkins commented 2 years ago

I run:

sv2v src/foo.sv -v -w adjacent

This works the first time, but then complains the file is already present. I'm pretty sure the behavior of other compilers is to overwite the output file. Preference to add an option (or change the default) to be consistent with this behavior, e.g. --overwrite-existing.

zachjs commented 2 years ago

I think given that -w now allows overwriting an individual file "blindly" (i.e., -w output.v), it probably makes sense for -w adj to match. sed -i somewhat amusingly exhibits this more cavalier behavior too, probably for the same reason: it's annoying to have to remove the generated files manually.

zachjs commented 2 years ago

I made this change in f868f06e888a1d89eb5e2c60b37aa1b7a0d60caf.

hughperkins commented 2 years ago

Awesome. Thank you :)