From 3d28faf16f7c1f172aebd9397155ceedc58ddb5a Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sat, 3 Sep 2011 15:20:05 -0400 Subject: [PATCH] more typos being fixed --- whalesong-helpers.rkt | 4 ++-- whalesong.rkt | 25 ++++++++----------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/whalesong-helpers.rkt b/whalesong-helpers.rkt index b154c5d..9184368 100644 --- a/whalesong-helpers.rkt +++ b/whalesong-helpers.rkt @@ -120,7 +120,7 @@ (build-path (current-output-dir) (resource-key r)))]))]) (fprintf (current-report-port) - (format "Writing program ~s" (build-path (current-output-port) output-js-filename))) + (format "Writing program ~s" (build-path (current-output-dir) output-js-filename))) (call-with-output-file* (build-path (current-output-dir) output-js-filename) (lambda (op) (display (get-runtime) op) @@ -129,7 +129,7 @@ #:exists 'replace) (fprintf (current-report-port) - (format "Writing html ~s" (build-path (current-output-port) output-html-filename))) + (format "Writing html ~s" (build-path (current-output-dir) output-html-filename))) (call-with-output-file* (build-path (current-output-dir) output-html-filename) (lambda (op) (display (get-html-template output-js-filename) op)) diff --git a/whalesong.rkt b/whalesong.rkt index b1ce3a4..1608f08 100755 --- a/whalesong.rkt +++ b/whalesong.rkt @@ -29,7 +29,7 @@ ;; ;; $ whalesong get-javascript main-module-name.rkt - +(define as-standalone-html? (make-parameter #f)) (define (at-toplevel) @@ -37,21 +37,6 @@ #:program "whalesong" #:argv (current-command-line-arguments) "The Whalesong command-line tool for compiling Racket to JavaScript" - ["build-xhtml" "build a standalone xhtml package" - "Builds a Racket program and its required dependencies into a .xhtml file." - #:once-each - [("-v" "--verbose") - ("Display verbose messages.") - (current-verbose? #t)] - [("--compress-javascript") - ("Compress JavaScript with Google Closure (requires Java)") - (current-compress-javascript? #t)] - [("--dest-dir") - dest-dir - ("Set destination directory (default: current-directory)") - (current-output-dir dest-dir)] - #:args (path) - (build-standalone-xhtml path)] ["build" "build a standalone html and javascript package" "Builds a Racket program and its required dependencies into a .html and .js file." #:once-each @@ -65,8 +50,14 @@ dest-dir ("Set destination directory (default: current-directory)") (current-output-dir dest-dir)] + [("--as-standalone-xhtml") + ("Write single standalone xhtml file") + (as-standalone-html? #t)] #:args (path) - (build-html-and-javascript path)] + + (if (as-standalone-html?) + (build-standalone-xhtml path) + (build-html-and-javascript path))] ["get-runtime" "print the runtime library to standard output" "Prints the runtime JavaScript library that's used by Whalesong programs."