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
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:
```shell

View File

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