diff options
| author | Dennis Fink | 2026-02-25 20:18:32 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-02-25 20:20:48 +0100 |
| commit | c5726497460845f55b74e19d9a40d5f949656499 (patch) | |
| tree | 41ef730807d8ed2664b31bf04f4d4b13c16a6d98 | |
| parent | c7b0c8790709186811ba44bda04ebcc8c81f8256 (diff) | |
| download | transcode.sh-c5726497460845f55b74e19d9a40d5f949656499.tar.gz transcode.sh-c5726497460845f55b74e19d9a40d5f949656499.zip | |
feat(core): add warn() and downgrade --saving-file diagnostic to warning
The --saving-file without --saving condition is non-fatal, so using
error() was misleading. Introduce warn() (yellow output, respects
--quiet) and use it for this diagnostic instead.
Diffstat (limited to '')
| -rwxr-xr-x | transcode.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/transcode.sh b/transcode.sh index ae53b5f..749668c 100755 --- a/transcode.sh +++ b/transcode.sh @@ -165,6 +165,14 @@ msg() { fi } +warn() { + if [[ $QUIET -eq 0 ]]; then + local mesg="$1" + shift + printf "${BOLD}${YELLOW}==>${ALL_OFF} ${BOLD}%s${ALL_OFF} %s\n" "$mesg" "$@" + fi +} + verbose() { if [[ $VERBOSE -eq 1 && $QUIET -eq 0 ]]; then local mesg="$1" @@ -580,7 +588,7 @@ if [[ $SAVING -eq 1 ]]; then fi if [[ $SAVING_FILE_EXPLICIT -eq 1 && $SAVING -eq 0 ]]; then - error "--saving-file has no effect without --saving" + warn "--saving-file has no effect without --saving" fi if [[ ! "$NICE_VALUE" =~ ^-?[0-9]+$ ]] || ((NICE_VALUE < -20 || NICE_VALUE > 19)); then |
