commit ad3d70ec9465cc07f2e0c64d3bf4f9a332b87d1a
parent 2963442bded6ce16f0f14ad3a932bf0c3db0b836
Author: Ryan Culpepper <ryanc@racket-lang.org>
Date: Sat, 4 May 2013 03:55:01 -0400
added raco commands for check-requires, show-dependencies
original commit: 22b9548ecb06e60ddec9a6527bca31807268d9bd
Diffstat:
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git 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
@@ -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
@@ -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)))