diff --git a/collects/macro-debugger/analysis/check-requires.rkt b/collects/macro-debugger/analysis/check-requires.rkt index 5c42a8f..1b13c89 100644 --- a/collects/macro-debugger/analysis/check-requires.rkt +++ b/collects/macro-debugger/analysis/check-requires.rkt @@ -227,7 +227,8 @@ and simplifies the replacements lists. ;; ======================================== -(require racket/cmdline) +(require racket/cmdline + raco/command-name) (provide main) #| @@ -271,6 +272,7 @@ Example (from racket root directory): ;; Command-line args are interpreted as files if the file exists, ;; module names otherwise. (command-line + #:program (short-program+command-name) #:argv args #:once-each [("-k" "--show-keep") @@ -292,3 +294,6 @@ Example (from racket root directory): (unless (eof-object? (peek-char inport)) (error "bad module name:" arg)) (go mod))])))) + +(module* main #f + (apply main (vector->list (current-command-line-arguments)))) diff --git a/collects/macro-debugger/analysis/show-dependencies.rkt b/collects/macro-debugger/analysis/show-dependencies.rkt index 2114343..fdb7726 100644 --- a/collects/macro-debugger/analysis/show-dependencies.rkt +++ b/collects/macro-debugger/analysis/show-dependencies.rkt @@ -1,6 +1,7 @@ #lang racket/base (require racket/cmdline racket/match + raco/command-name syntax/modresolve "private/util.rkt") (provide get-dependencies @@ -112,6 +113,7 @@ (define excludes null) (define exclude-deps null) (command-line + #:program (short-program+command-name) #:argv argv #:once-each [("-c" "--context") "Show who directly requires each module" @@ -145,6 +147,9 @@ #:show-context? context? (map ->modpath module-path))))) +(module* main #f + (apply main (vector->list (current-command-line-arguments)))) + #| For example, diff --git a/collects/macro-debugger/info.rkt b/collects/macro-debugger/info.rkt index 8af2813..5db356c 100644 --- a/collects/macro-debugger/info.rkt +++ b/collects/macro-debugger/info.rkt @@ -4,3 +4,13 @@ (define drracket-tool-names '("Macro Stepper")) (define drracket-tool-icons (list '("macro-stepper-32x32.png" "icons"))) (define scribblings '(("macro-debugger.scrbl" () (tool-library)))) + +(define raco-commands + '(("check-requires" + (submod macro-debugger/analysis/check-requires main) + "check for useless requires" + #f) + ("show-dependencies" + (submod macro-debugger/analysis/show-dependencies main) + "show module dependencies" + #f)))