From 4d505d1a684a34af9887d25ed46101cde2622050 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 8 May 2022 19:05:52 +0200 Subject: option.lisp: Only error if required arguments are missing I forgot the condition that only errors when the required arguments are missing. --- src/option.lisp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/option.lisp b/src/option.lisp index e2af930..a37779c 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -99,12 +99,13 @@ with code `exit-code`." #'(lambda (missing-and-opt) (first missing-and-opt)) opts-missing-p)))) - (format - *error-output* - "error: missing required options: ~{`~(--~A~)'~^, ~}~%" - missing-opts) + (when (not (null missing-opts)) + (format + *error-output* + "error: missing required options: ~{`~(--~A~)'~^, ~}~%" + missing-opts) - (opts:exit sysexits:+usage+)) + (opts:exit sysexits:+usage+))) ;; If `sendmail` is given, `email-to` must be defined. (when (not (null (getf options :sendmail))) -- cgit v1.2.3