guix build: Factorize transformation option parsing.
* guix/scripts/build.scm (%transformation-options): Introduce 'parser' procedure and use it.master
parent
5cf01aa53f
commit
31c2fd1e01
|
@ -219,16 +219,15 @@ called \"guile\" must be replaced with a dependency on a version 2.1 of
|
||||||
|
|
||||||
(define %transformation-options
|
(define %transformation-options
|
||||||
;; The command-line interface to the above transformations.
|
;; The command-line interface to the above transformations.
|
||||||
(list (option '("with-source") #t #f
|
(let ((parser (lambda (symbol)
|
||||||
(lambda (opt name arg result . rest)
|
(lambda (opt name arg result . rest)
|
||||||
(apply values
|
(apply values
|
||||||
(cons (alist-cons 'with-source arg result)
|
(alist-cons symbol arg result)
|
||||||
rest))))
|
rest)))))
|
||||||
(option '("with-input") #t #f
|
(list (option '("with-source") #t #f
|
||||||
(lambda (opt name arg result . rest)
|
(parser 'with-source))
|
||||||
(apply values
|
(option '("with-input") #t #f
|
||||||
(cons (alist-cons 'with-input arg result)
|
(parser 'with-input)))))
|
||||||
rest))))))
|
|
||||||
|
|
||||||
(define (show-transformation-options-help)
|
(define (show-transformation-options-help)
|
||||||
(display (_ "
|
(display (_ "
|
||||||
|
|
Reference in New Issue