From 054a300fe5b81ed04f84e902e05c4f4efb95a193 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sat, 16 May 2026 12:39:15 +0200 Subject: feat(backup): add original file backups Add --backup-dir support so successful encodes can copy the original file to an existing backup directory before replacing it. Preserve each source file's absolute path below the backup directory and avoid overwriting existing backups by appending numeric suffixes when needed. Document the new CLI and config option, and add directory completion for the backup path. --- transcode.sh.bash-completion | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'transcode.sh.bash-completion') diff --git a/transcode.sh.bash-completion b/transcode.sh.bash-completion index 7c6eefa..7a0529d 100644 --- a/transcode.sh.bash-completion +++ b/transcode.sh.bash-completion @@ -50,6 +50,11 @@ _transcode_sh() { _filedir return ;; + --backup-dir=*) + cur="${cur#*=}" + _filedir -d + return + ;; --encode-file=*) cur="${cur#*=}" _filedir @@ -92,6 +97,10 @@ _transcode_sh() { _filedir return ;; + --backup-dir) + _filedir -d + return + ;; -f | --encode-file) _filedir return @@ -128,6 +137,8 @@ _transcode_sh() { case "$cur" in --*) local longopts=' + --backup-dir + --backup-dir= --color --config-file --config-file= -- cgit v1.3.1