diff --git a/racket/collects/pkg/private/new.rkt b/racket/collects/pkg/private/new.rkt index 3cec4aaf78..5e2a677fdf 100644 --- a/racket/collects/pkg/private/new.rkt +++ b/racket/collects/pkg/private/new.rkt @@ -207,13 +207,29 @@ EOS ;; Code here + + (module+ test - ;; Tests to be run with raco test - ) + ;; Any code in this `test` submodule runs when this file is run using DrRacket + ;; or with `raco test`. The code here does not run when this file is + ;; required by another module. + + (check-equal? (+ 2 2) 4)) (module+ main - ;; Main entry point, executed when run with the `racket` executable or DrRacket. - ) + ;; (Optional) main submodule. Put code here if you need it to be executed when + ;; this file is run using DrRacket or the `racket` executable. The code here + ;; does not run when this file is required by another module. Documentation: + ;; http://docs.racket-lang.org/guide/Module_Syntax.html#%28part._main-and-test%29 + + (require racket/cmdline) + (define who (box "world")) + (command-line + #:program "my-program" + #:once-each + [("-n" "--name") name "Who to say hello to" (set-box! who name)] + #:args () + (printf "hello ~a~n" (unbox who)))) EOS )))