1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 17:20:29 +02:00

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.
This commit is contained in:
Andy Wingo 2020-05-11 11:14:30 +02:00
parent 21885aa4ba
commit 6c741a04ef

View file

@ -46,8 +46,8 @@
(define %summary "Compile a file.") (define %summary "Compile a file.")
(define (fail . messages) (define (fail message . args)
(format (current-error-port) "error: ~{~a~}~%" messages) (format (current-error-port) "error: ~?~%" message args)
(exit 1)) (exit 1))
(define %options (define %options
@ -260,11 +260,10 @@ Report bugs to <~A>.~%"
(set! %load-path (append load-path %load-path)) (set! %load-path (append load-path %load-path))
(set! %load-should-auto-compile #f) (set! %load-should-auto-compile #f)
(if (and output-file (when (and output-file
(or (null? input-files) (or (null? input-files)
(not (null? (cdr input-files))))) (not (null? (cdr input-files)))))
(fail "`-o' option can only be specified " (fail "`-o' option can only be specified when compiling a single file"))
"when compiling a single file"))
;; Install a SIGINT handler. As a side effect, this gives unwind ;; Install a SIGINT handler. As a side effect, this gives unwind
;; handlers an opportunity to run upon SIGINT; this includes that of ;; handlers an opportunity to run upon SIGINT; this includes that of