diff --git a/collects/setup/setup-cmdline.rkt b/collects/setup/setup-cmdline.rkt
index b141b66068..6b75f07422 100644
--- a/collects/setup/setup-cmdline.rkt
+++ b/collects/setup/setup-cmdline.rkt
@@ -80,7 +80,7 @@
[("--doc-pdf") dir "Write doc PDF to
"
(add-flags `((doc-pdf-dest ,dir)))]
[("-l") => (lambda (flag . collections)
- (check-collections collections)
+ (check-collections short-name collections)
(cons 'collections (map list collections)))
'("Setup specific s only" "collection")]
[("-A") => (λ (flag . archives)
@@ -103,7 +103,7 @@
'())])
(cond
[raco?
- (check-collections rest)
+ (check-collections short-name rest)
(values (append pre-collections (map list rest))
pre-archives)]
[else
@@ -119,15 +119,16 @@
(values short-name x-flags x-specific-collections x-specific-planet-packages x-archives))
-(define (check-collections collections)
+(define (check-collections name collections)
(for ((v (in-list collections)))
;; A normal-form collection path matches a symbolic module path;
;; this is a bit of a hack, but it's not entirely a coincidence:
(unless (module-path? (string->symbol v))
- (error (format "bad collection path~a: ~a"
- (cond [(regexp-match? #rx"/$" v)
- " (trailing slash not allowed)"]
- [(regexp-match? #rx"\\\\" v)
- " (backslash not allowed)"]
- [else ""])
- v)))))
+ (raise-user-error (string->symbol name)
+ "bad collection path~a: ~a"
+ (cond [(regexp-match? #rx"/$" v)
+ " (trailing slash not allowed)"]
+ [(regexp-match? #rx"\\\\" v)
+ " (backslash not allowed)"]
+ [else ""])
+ v))))