spdx / tools

SPDX Tools
Apache License 2.0
129 stars 70 forks source link

Enhancement Request - Prompt user for overwriting destination files #136

Open goneall opened 6 years ago

goneall commented 6 years ago

If a destination file for an SPDX tool command already exist, the command files with a Error: File [file] already exists - please specify a new file. It would be easier for the interactive user if prompted to overwrite.

Prompting could cause issues for the application being run in a script. Suggest an option to allow prompting or have the overwrite be an option on the command line. I prefer the latter: "-overwrite option would overwrite the destination file(s) if it already exists".

Moved from Bugzilla Bug 1202

jeremiah commented 6 years ago

Another option that is often used, by tools like curl for example, is to create a new file with the same name but with a suffix or prefix that clearly shows it is the same file but a different version. Often it is a semantic like file-1.txt that is created. So you can have file.txt, file-1.txt, file-2.txt, etc. This way you never destroy the users data which ought to be a cardinal rule.