From 6c741a04eff2c2687bb2266e0538491f0aa72a32 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 11 May 2020 11:14:30 +0200 Subject: [PATCH] Fix "fail" helper in guild compile * module/scripts/compile.scm (fail): Users expect this to be a format string, so adapt. (compile): Fix use that passed multiple strings. --- module/scripts/compile.scm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm index 5d91538c3..6440c4086 100644 --- a/module/scripts/compile.scm +++ b/module/scripts/compile.scm @@ -46,8 +46,8 @@ (define %summary "Compile a file.") -(define (fail . messages) - (format (current-error-port) "error: ~{~a~}~%" messages) +(define (fail message . args) + (format (current-error-port) "error: ~?~%" message args) (exit 1)) (define %options @@ -260,11 +260,10 @@ Report bugs to <~A>.~%" (set! %load-path (append load-path %load-path)) (set! %load-should-auto-compile #f) - (if (and output-file - (or (null? input-files) - (not (null? (cdr input-files))))) - (fail "`-o' option can only be specified " - "when compiling a single file")) + (when (and output-file + (or (null? input-files) + (not (null? (cdr input-files))))) + (fail "`-o' option can only be specified when compiling a single file")) ;; Install a SIGINT handler. As a side effect, this gives unwind ;; handlers an opportunity to run upon SIGINT; this includes that of