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 suffix (filename-extension a-path))
|
||||||
(define default-cmd
|
(define default-cmd
|
||||||
(and suffix
|
(and suffix
|
||||||
(cond
|
(case (string->symbol (bytes->string/utf-8 suffix))
|
||||||
[(ormap (lambda (bs) (bytes=? suffix bs))
|
[(ss scm scrbl rkt sls) '(racket *)]
|
||||||
(list #"ss" #"scm" #"scrbl" #"rkt" #"sls"))
|
[(rktl) '(racket "-f" *)]
|
||||||
'(racket "-qt" *)]
|
[else #f])))
|
||||||
[(ormap (lambda (bs) (bytes=? suffix bs))
|
|
||||||
(list #"rktl"))
|
|
||||||
'(racket "-f" *)]
|
|
||||||
[else
|
|
||||||
#f])))
|
|
||||||
(define (replace-* s)
|
(define (replace-* s)
|
||||||
(if (eq? '* s)
|
(if (eq? '* s)
|
||||||
(path->string* a-path)
|
(path->string* a-path)
|
||||||
|
|
|
@ -531,9 +531,12 @@ path/s is either such a string or a list of them.
|
||||||
;; --------------------
|
;; --------------------
|
||||||
(Prop
|
(Prop
|
||||||
'drdr:command-line
|
'drdr:command-line
|
||||||
(string-append
|
(string-join
|
||||||
"command-line string (space-separated,\n missing => default execution,"
|
'("command-line string"
|
||||||
" empty => no execution, \"~s\" => the file)")
|
"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)
|
(lambda (str)
|
||||||
(define (bad) (error "expecting an empty string, or one with `~s'"))
|
(define (bad) (error "expecting an empty string, or one with `~s'"))
|
||||||
(if (equal? str "")
|
(if (equal? str "")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user