guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/02: Fix "fail" helper in guild compile


From: Andy Wingo
Subject: [Guile-commits] 01/02: Fix "fail" helper in guild compile
Date: Mon, 11 May 2020 05:28:00 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 6c741a04eff2c2687bb2266e0538491f0aa72a32
Author: Andy Wingo <address@hidden>
AuthorDate: Mon May 11 11:14:30 2020 +0200

    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 5d91538..6440c40 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]