From 7e73a76bba167c2a6d5bd9afc145690c5049ebf2 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 8 May 2026 19:41:14 +0200 Subject: feat(cli)!: add TOML config file support Add a structured config file so common defaults can live in one place instead of being repeated in aliases or shell wrappers. CLI flags keep precedence, which keeps one-off overrides predictable. Use tomlq only when a config file is present, and fail early on missing dependencies or invalid TOML so configuration mistakes do not silently change encode behavior. Move the persistent skip-codec list from the legacy skip.conf file to [skip] codecs in config.toml. Config codecs are merged with --skip-codec so global defaults and per-run skips can be combined. Document the new format in the README and man page, update dependency notes, and extend bash completion for config-file paths and the new negative boolean flags. BREAKING CHANGE: skip.conf is no longer read for codec skips. Migrate its entries to [skip] codecs in config.toml and remove the old file. BREAKING CHANGE: --encodefile and --encodefile= are replaced by --encode-file and --encode-file=. Update scripts, aliases, and completion usage to use the hyphenated option name. --- transcode.sh.bash-completion | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'transcode.sh.bash-completion') diff --git a/transcode.sh.bash-completion b/transcode.sh.bash-completion index ce153dd..59a9c8d 100644 --- a/transcode.sh.bash-completion +++ b/transcode.sh.bash-completion @@ -6,8 +6,8 @@ # # Each option that takes an argument is supported in all three forms: # short -f list.txt -# long space --encodefile list.txt -# long equals --encodefile=list.txt +# long space --encode-file list.txt +# long equals --encode-file=list.txt _transcode_sh() { local cur prev words cword @@ -40,7 +40,12 @@ _transcode_sh() { # This must be checked before the $prev dispatch below. # --------------------------------------------------------------------------- case "$cur" in - --encodefile=*) + --config-file=*) + cur="${cur#*=}" + _filedir + return + ;; + --encode-file=*) cur="${cur#*=}" _filedir return @@ -69,11 +74,15 @@ _transcode_sh() { # --------------------------------------------------------------------------- # Handle VALUE after short form (-f, -N, -S, -p) and - # long space form (--encodefile, --nice, --saving-file, --skip-codec, --preset). + # long space form (--encode-file, --nice, --saving-file, --skip-codec, --preset). # $prev is the option word, $cur is the value being typed. # --------------------------------------------------------------------------- case "$prev" in - -f|--encodefile) + --config-file) + _filedir + return + ;; + -f|--encode-file) _filedir return ;; @@ -106,17 +115,22 @@ _transcode_sh() { --*) local longopts=' --continue - --encodefile - --encodefile= + --no-continue + --config-file + --config-file= + --encode-file + --encode-file= --dry-run --nice --nice= --saving + --no-saving --saving-file --saving-file= --skip-codec --skip-codec= --only-if-smaller + --no-only-if-smaller --preset --preset= --help -- cgit v1.3.1