raco: fix command name selection by prefix
Repairs a problem with 409321c03b
.
Merge to v6.9
This commit is contained in:
parent
016b8009c5
commit
662fd84eda
15
pkgs/racket-test-extra/tests/raco/prefix.rkt
Normal file
15
pkgs/racket-test-extra/tests/raco/prefix.rkt
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang racket/base
|
||||
(require compiler/find-exe
|
||||
racket/system)
|
||||
|
||||
;; Make sure that `raco` recognizes unambiguous command prefixes.
|
||||
;; This test assumes that "pk" will unambiguously refer to "pkg".
|
||||
|
||||
(define o (open-output-bytes))
|
||||
(parameterize ([current-output-port o])
|
||||
(system* (find-exe)
|
||||
"-N" "raco"
|
||||
"-l-" "raco"
|
||||
"pk"))
|
||||
(unless (regexp-match? #rx"raco pkg install" (get-output-bytes o))
|
||||
(error "expected output from `raco pkg`"))
|
|
@ -52,7 +52,7 @@
|
|||
[tool (and (pair? cmdline)
|
||||
(or (hash-ref tools (car cmdline) #f)
|
||||
(and (= (hash-count prefix-tools) 1)
|
||||
(hash-ref tools (car cmdline) #f))))]
|
||||
(car (hash-values prefix-tools)))))]
|
||||
[ambiguous? (> (hash-count prefix-tools) 1)]
|
||||
[show-all?
|
||||
(cond
|
||||
|
|
Loading…
Reference in New Issue
Block a user