added raco commands for check-requires, show-dependencies
original commit: 22b9548ecb06e60ddec9a6527bca31807268d9bd
This commit is contained in:
parent
2963442bde
commit
ad3d70ec94
|
@ -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))))
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue
Block a user