Compare commits

...

2 commits

Author SHA1 Message Date
Dan Church
564366dc90
Simplify check_required_binaries function 2025-11-09 10:37:08 -06:00
Dan Church
ac6129a7ae
Simplify case statement
Don't surround variables with quotes, they're not necessary in Bash.
2024-11-24 11:19:05 -06:00

View file

@ -27,7 +27,7 @@ Optimize PDF files for size.
--no-preserve-timestamp Omit timestamp from original file (default). --no-preserve-timestamp Omit timestamp from original file (default).
-- Terminate options list. -- Terminate options list.
Copyright (C) 2021-2022 Dan Church. Copyright (C) 2021-2024 Dan Church.
License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html) License GPLv3: GNU GPL version 3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
with Commons Clause 1.0 (https://commonsclause.com/). with Commons Clause 1.0 (https://commonsclause.com/).
This is free software: you are free to change and redistribute it. This is free software: you are free to change and redistribute it.
@ -47,7 +47,7 @@ NO_MORE_FLAGS=0
for ARG; do for ARG; do
# Assume arguments that don't begin with a - are supposed to be files or other operands # Assume arguments that don't begin with a - are supposed to be files or other operands
if [[ $NO_MORE_FLAGS -eq 0 && $ARG = -* ]]; then if [[ $NO_MORE_FLAGS -eq 0 && $ARG = -* ]]; then
case "$ARG" in case $ARG in
--backup=*) --backup=*)
KEEP_BACKUP_SUFFIX=${ARG#*=} KEEP_BACKUP_SUFFIX=${ARG#*=}
;; ;;
@ -114,9 +114,7 @@ check_required_binaries() {
done done
if [[ ${#MISSING[@]} -gt 0 ]]; then if [[ ${#MISSING[@]} -gt 0 ]]; then
printf 'Error: You are missing required programs:\n' >&2 printf 'Error: You are missing required programs:\n' >&2
for BIN in "${MISSING[@]}"; do printf -- '- %s\n' "${MISSING[@]}" >&2
printf -- '- %s\n' "$BIN" >&2
done
exit 2 exit 2
fi fi
} }