From d2cee683e4724b06b428b91df646f47d21779c3f Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 19 Jun 2012 05:29:20 -0400 Subject: [PATCH] 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"). --- collects/meta/drdr/metadata.rkt | 13 ++++--------- collects/meta/props | 9 ++++++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/collects/meta/drdr/metadata.rkt b/collects/meta/drdr/metadata.rkt index f3e25f46c4..076a616b0f 100644 --- a/collects/meta/drdr/metadata.rkt +++ b/collects/meta/drdr/metadata.rkt @@ -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) diff --git a/collects/meta/props b/collects/meta/props index 5b2a0bed6d..31abd0b5c3 100755 --- a/collects/meta/props +++ b/collects/meta/props @@ -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 "")