From 32e28dae0094995a3cd9ea4bf1f3cfc0176a777e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 13 Apr 2023 11:37:45 +0300 Subject: [PATCH] several fixes and some cleanup... Signed-off-by: Alex A. Naanou --- scripts/cls2tex.sh | 15 +++++---------- scripts/make-spreads.sh | 9 ++++++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/cls2tex.sh b/scripts/cls2tex.sh index 9119cd6..5461207 100755 --- a/scripts/cls2tex.sh +++ b/scripts/cls2tex.sh @@ -54,13 +54,6 @@ printhelp(){ echo " in both the repo and in installed form, so .dtx is not used." } -# Usage: printerror MESSAGE... -printerror(){ - echo Error: $@ - echo - printusage -} - # Usage: printmsg TEXT printmsg(){ # print message... @@ -88,21 +81,23 @@ while true ; do ;; -p|--prefix) PREFIX=$2 - shift - shift + shift 2 + continue ;; -s|--strip) STRIP_DOC=1 shift + continue ;; -n|--no-msg) NO_MSG=1 shift + continue ;; # handle unknown options... -*|--*) - printerror "unknown option \"$1\"" + echo "Error: unknown option: \"$1\"" >&2 exit ;; diff --git a/scripts/make-spreads.sh b/scripts/make-spreads.sh index 1b10fc5..6505e10 100644 --- a/scripts/make-spreads.sh +++ b/scripts/make-spreads.sh @@ -177,38 +177,45 @@ while true ; do -a|--annotate) ANOTATE_IMAGE_PATHS=1 shift + continue ;; -c) $CONFIG="$2" [ -e "$CONFIG" ] \ && source "$CONFIG" shift 2 + continue ;; --templates) TEMPLATE_DIR=$2 shift 2 + continue ;; --single-image-tpl) IMAGE_SPREAD[1]=$2 shift 2 + continue ;; --double-image-tpl) IMAGE_SPREAD[2]=$2 shift 2 + continue ;; --text-spread-tpl) IMAGE_SPREAD[0]=$2 shift 2 + continue ;; --captions) CAPTION_DIR=$2 shift 2 + continue ;; # handle unknown options... -*|--*) - echo "Error: unknown option \"$1\"" + echo "Error: unknown option \"$1\"" >&2 exit ;;