Improve drdr suffix-decision code, and the help text for prop setting.
The code is improved, and also the default changes for *.rkt files: there is no need for any flags -- "-q" is redundant, and with no flags it's doing "-u" which is the same as "-t" (with an added "-N").
This commit is contained in:
parent
125fbaa3ce
commit
d2cee683e4
|
@ -10,15 +10,10 @@
|
|||
(define suffix (filename-extension a-path))
|
||||
(define default-cmd
|
||||
(and suffix
|
||||
(cond
|
||||
[(ormap (lambda (bs) (bytes=? suffix bs))
|
||||
(list #"ss" #"scm" #"scrbl" #"rkt" #"sls"))
|
||||
'(racket "-qt" *)]
|
||||
[(ormap (lambda (bs) (bytes=? suffix bs))
|
||||
(list #"rktl"))
|
||||
'(racket "-f" *)]
|
||||
[else
|
||||
#f])))
|
||||
(case (string->symbol (bytes->string/utf-8 suffix))
|
||||
[(ss scm scrbl rkt sls) '(racket *)]
|
||||
[(rktl) '(racket "-f" *)]
|
||||
[else #f])))
|
||||
(define (replace-* s)
|
||||
(if (eq? '* s)
|
||||
(path->string* a-path)
|
||||
|
|
|
@ -531,9 +531,12 @@ path/s is either such a string or a list of them.
|
|||
;; --------------------
|
||||
(Prop
|
||||
'drdr:command-line
|
||||
(string-append
|
||||
"command-line string (space-separated,\n missing => default execution,"
|
||||
" empty => no execution, \"~s\" => the file)")
|
||||
(string-join
|
||||
'("command-line string"
|
||||
"space-separated with \"~s\" for the file, empty => no execution,"
|
||||
"missing => use the default (\"racket ~s\" for *.rkt etc,"
|
||||
"\"racket -f ~s\" for *.rktl)")
|
||||
"\n ")
|
||||
(lambda (str)
|
||||
(define (bad) (error "expecting an empty string, or one with `~s'"))
|
||||
(if (equal? str "")
|
||||
|
|
Loading…
Reference in New Issue
Block a user