implement command line
This commit is contained in:
parent
2a1898dedd
commit
c013758162
|
@ -516,3 +516,19 @@
|
|||
(hash-set! acc pkg-name 'installed)
|
||||
|
||||
(void)))
|
||||
|
||||
(module+ main
|
||||
(require racket/cmdline)
|
||||
(define force? (make-parameter #f))
|
||||
(define base-dir (make-parameter (build-path "racket-catalog")))
|
||||
(command-line
|
||||
#:program "racket2nix"
|
||||
#:once-each
|
||||
[("-f" "--force") "Overwrite existing nix files" (force? #t)]
|
||||
[("-d" "--base-dir") bd "Base directory for nix files" (base-dir (bd))]
|
||||
#:args (pkg . more-pkgs)
|
||||
|
||||
(define acc (make-hash))
|
||||
(for ([pkg (in-list (cons pkg more-pkgs))])
|
||||
(racket2nix pkg (force?) (base-dir) acc))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue