adde -c PATH option to make-spreads.sh...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-03-12 00:45:46 +03:00
parent a008cdccf1
commit 566e81fff7
2 changed files with 18 additions and 17 deletions

View File

@ -315,8 +315,7 @@ but with a .txt extension.
All the configuration options can be given in a configuration file as All the configuration options can be given in a configuration file as
well as environment variables. well as environment variables.
<!-- XXX this is not true at the moment, not sure if this is a bug or a feature... Environment variables take precedence over the configuration file.
Environment variables take precedence over the configuration file. -->
The default `make-images.cfg` would look something like: The default `make-images.cfg` would look something like:
```shell ```shell

View File

@ -216,17 +216,18 @@ printhelp(){
echo echo
echo "Arguments:" echo "Arguments:"
echo " -h --help - print this help and exit." echo " -h --help - print this help and exit."
echo " -c PATH - load configuration from PATH."
echo " -a --annotate" echo " -a --annotate"
echo " - add annotations with image paths to pages." echo " - add annotations with image paths to pages."
echo " --templates=PATH" echo " --templates PATH"
echo " - path to search for templates (default: $TEMPLATE_DIR)." echo " - path to search for templates (default: $TEMPLATE_DIR)."
echo " --single-image-tpl=NAME" echo " --single-image-tpl NAME"
echo " - single image default template (default: ${IMAGE_SPREAD[1]})." echo " - single image default template (default: ${IMAGE_SPREAD[1]})."
echo " --double-image-tpl=NAME" echo " --double-image-tpl NAME"
echo " - double image default template (default: ${IMAGE_SPREAD[2]})." echo " - double image default template (default: ${IMAGE_SPREAD[2]})."
echo " --text-spread-tpl=NAME" echo " --text-spread-tpl NAME"
echo " - text spread default template (default: ${IMAGE_SPREAD[0]})." echo " - text spread default template (default: ${IMAGE_SPREAD[0]})."
echo " --captions=PATH" echo " --captions PATH"
echo " - path to search for captions (default: $CAPTION_DIR)." echo " - path to search for captions (default: $CAPTION_DIR)."
echo echo
echo "Parameters:" echo "Parameters:"
@ -276,31 +277,32 @@ while true ; do
ANOTATE_IMAGE_PATHS=1 ANOTATE_IMAGE_PATHS=1
shift shift
;; ;;
-c)
$CONFIG="$2"
[ -e "$CONFIG" ] \
&& source "$CONFIG"
shift 2
;;
--templates) --templates)
TEMPLATE_DIR=$2 TEMPLATE_DIR=$2
shift shift 2
shift
;; ;;
--single-image-tpl) --single-image-tpl)
IMAGE_SPREAD[1]=$2 IMAGE_SPREAD[1]=$2
shift shift 2
shift
;; ;;
--double-image-tpl) --double-image-tpl)
IMAGE_SPREAD[2]=$2 IMAGE_SPREAD[2]=$2
shift shift 2
shift
;; ;;
--text-spread-tpl) --text-spread-tpl)
IMAGE_SPREAD[0]=$2 IMAGE_SPREAD[0]=$2
shift shift 2
shift
;; ;;
--captions) --captions)
CAPTION_DIR=$2 CAPTION_DIR=$2
shift shift 2
shift
;; ;;
# handle unknown options... # handle unknown options...