From e0e48665f8a183b7eeb0f5e5219e9782af6f1efc Mon Sep 17 00:00:00 2001 From: Silas Vedder Date: Thu, 20 Oct 2022 21:16:34 +0200 Subject: [PATCH] Bugfix in read-bible.in: help message displayed w/o args --- scripts/read-bible.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/read-bible.in b/scripts/read-bible.in index 727d268..584109f 100644 --- a/scripts/read-bible.in +++ b/scripts/read-bible.in @@ -31,11 +31,13 @@ exec guile -e '(@ (read-bible) main)' -s "$0" "$@" (define-syntax conf (syntax-rules (else) ((_ (f e)... (else g)) (cond ((flag? f) e)... (else g))))) - (with-bible (cadr args) - (conf ("-h" (help)) - ("-v" (version)) - ("-b" (if (flag? "-c") - (call-with-chapter (get "-b") (get "-c") - print-text) - (call-with-book (get "-b") print-text))) - (else (help))))) + (if (< (length args) 2) + (help) + (with-bible (cadr args) + (conf ("-h" (help)) + ("-v" (version)) + ("-b" (if (flag? "-c") + (call-with-chapter (get "-b") (get "-c") + print-text) + (call-with-book (get "-b") print-text))) + (else (help))))))