racket/pkgs/compiler-lib/compiler/demodularizer/batch.rkt
Matthew Flatt 59ef254318 switch to a new, Racket-implemented expander & module system
This commit merges changes that were developed in the "racket7" repo.
See that repo (which is no longer modified) for a more fine-grained
change history.

The commit includes experimental support for running Racket on Chez
Scheme, but that "CS" variant is not built by default.
2018-02-26 13:19:53 -07:00

23 lines
999 B
Racket

#lang racket/base
(require racket/cmdline
racket/set
raco/command-name
"main.rkt")
(let ([output-file (make-parameter #f)])
(command-line #:program (short-program+command-name)
#:multi
[("-e" "--exclude-modules") path "Exclude <path> from flattening"
(current-excluded-modules (set-add (current-excluded-modules) path))]
#:once-each
[("-o") dest-filename "Write output as <dest-filename>"
(output-file (string->path dest-filename))]
[("-g" "--garbage-collect") "Garbage-collect final module (unsound)"
(garbage-collect-toplevels-enabled #t)]
[("-r" "--recompile") "Recompile final module to re-run optimizations"
(recompile-enabled #t)]
#:args (filename)
(demodularize filename (output-file))))
(module test racket/base)