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)
|
(provide main)
|
||||||
|
|
||||||
#|
|
#|
|
||||||
|
@ -271,6 +272,7 @@ Example (from racket root directory):
|
||||||
;; Command-line args are interpreted as files if the file exists,
|
;; Command-line args are interpreted as files if the file exists,
|
||||||
;; module names otherwise.
|
;; module names otherwise.
|
||||||
(command-line
|
(command-line
|
||||||
|
#:program (short-program+command-name)
|
||||||
#:argv args
|
#:argv args
|
||||||
#:once-each
|
#:once-each
|
||||||
[("-k" "--show-keep")
|
[("-k" "--show-keep")
|
||||||
|
@ -292,3 +294,6 @@ Example (from racket root directory):
|
||||||
(unless (eof-object? (peek-char inport))
|
(unless (eof-object? (peek-char inport))
|
||||||
(error "bad module name:" arg))
|
(error "bad module name:" arg))
|
||||||
(go mod))]))))
|
(go mod))]))))
|
||||||
|
|
||||||
|
(module* main #f
|
||||||
|
(apply main (vector->list (current-command-line-arguments))))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require racket/cmdline
|
(require racket/cmdline
|
||||||
racket/match
|
racket/match
|
||||||
|
raco/command-name
|
||||||
syntax/modresolve
|
syntax/modresolve
|
||||||
"private/util.rkt")
|
"private/util.rkt")
|
||||||
(provide get-dependencies
|
(provide get-dependencies
|
||||||
|
@ -112,6 +113,7 @@
|
||||||
(define excludes null)
|
(define excludes null)
|
||||||
(define exclude-deps null)
|
(define exclude-deps null)
|
||||||
(command-line
|
(command-line
|
||||||
|
#:program (short-program+command-name)
|
||||||
#:argv argv
|
#:argv argv
|
||||||
#:once-each
|
#:once-each
|
||||||
[("-c" "--context") "Show who directly requires each module"
|
[("-c" "--context") "Show who directly requires each module"
|
||||||
|
@ -145,6 +147,9 @@
|
||||||
#:show-context? context?
|
#:show-context? context?
|
||||||
(map ->modpath module-path)))))
|
(map ->modpath module-path)))))
|
||||||
|
|
||||||
|
(module* main #f
|
||||||
|
(apply main (vector->list (current-command-line-arguments))))
|
||||||
|
|
||||||
#|
|
#|
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
|
@ -4,3 +4,13 @@
|
||||||
(define drracket-tool-names '("Macro Stepper"))
|
(define drracket-tool-names '("Macro Stepper"))
|
||||||
(define drracket-tool-icons (list '("macro-stepper-32x32.png" "icons")))
|
(define drracket-tool-icons (list '("macro-stepper-32x32.png" "icons")))
|
||||||
(define scribblings '(("macro-debugger.scrbl" () (tool-library))))
|
(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