From d7bde56252bd8be1b60fac417f8014cfc9d8fb33 Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 1 Jul 2021 22:41:00 +0200 Subject: [PATCH] show a more helpful error message when passing "-l" to csc (suggested by jcroisant) --- csc.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/csc.scm b/csc.scm index 67223eea..1dd8840e 100644 --- a/csc.scm +++ b/csc.scm @@ -828,10 +828,14 @@ EOF (set! link-options (append link-options (list arg))) ] [(> (string-length arg) 2) (let ([opts (cdr (string->list arg))]) - (if (null? (lset-difference/eq? opts short-options)) - (set! rest - (append (map (lambda (o) (string-append "-" (string o))) opts) rest) ) - (stop "invalid option `~A'" arg) ) ) ] + (cond ((null? (lset-difference/eq? opts short-options)) + (set! rest + (append (map (lambda (o) + (string-append "-" (string o))) opts) + rest) )) + ((char=? #\l (car opts)) + (stop "invalid option `~A' - did you mean `-L -l'?" arg)) + (else (stop "invalid option `~A'" arg) ) )) ] [else (stop "invalid option `~A'" s)] ) ] [(file-exists? arg) (let-values ([(dirs name ext) (decompose-pathname arg)]) -- 2.26.2