Skip to content
Snippets Groups Projects
Unverified Commit 31c2fd1e authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

guix build: Factorize transformation option parsing.

* guix/scripts/build.scm (%transformation-options): Introduce 'parser'
procedure and use it.
parent 5cf01aa5
No related branches found
No related tags found
No related merge requests found
......@@ -219,16 +219,15 @@ (define %transformations
(define %transformation-options
;; The command-line interface to the above transformations.
(list (option '("with-source") #t #f
(lambda (opt name arg result . rest)
(apply values
(cons (alist-cons 'with-source arg result)
rest))))
(option '("with-input") #t #f
(lambda (opt name arg result . rest)
(apply values
(cons (alist-cons 'with-input arg result)
rest))))))
(let ((parser (lambda (symbol)
(lambda (opt name arg result . rest)
(apply values
(alist-cons symbol arg result)
rest)))))
(list (option '("with-source") #t #f
(parser 'with-source))
(option '("with-input") #t #f
(parser 'with-input)))))
(define (show-transformation-options-help)
(display (_ "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment