Problem
Each strategy runs rm -f "$OUTPUT_FILE" before writing (decrypt-pdf:313, :335, :357, ...). If a file already exists at the output path — including the default <input>_decrypted.pdf — it is deleted and replaced without any warning or confirmation. An accidental name clash (or a re-run) can silently destroy an unrelated file.
Suggested fix
- If
OUTPUT_FILE already exists (and is not the input), refuse with a clear error and non-zero exit, unless the user passes --force.
- Document the behavior in
--help.
Problem
Each strategy runs
rm -f "$OUTPUT_FILE"before writing (decrypt-pdf:313,:335,:357, ...). If a file already exists at the output path — including the default<input>_decrypted.pdf— it is deleted and replaced without any warning or confirmation. An accidental name clash (or a re-run) can silently destroy an unrelated file.Suggested fix
OUTPUT_FILEalready exists (and is not the input), refuse with a clear error and non-zero exit, unless the user passes--force.--help.