mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 21:59:08 -05:00
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
This commit is contained in:
parent
64ce53eb5e
commit
d68ba5f483
1 changed files with 13 additions and 6 deletions
|
@ -107,10 +107,17 @@ (define (guix-import . args)
|
|||
(show-version-and-exit "guix import"))
|
||||
((importer args ...)
|
||||
(if (member importer importers)
|
||||
(match (apply (resolve-importer importer) args)
|
||||
((and expr ('package _ ...))
|
||||
(pretty-print expr (newline-rewriting-port
|
||||
(current-output-port))))
|
||||
(x
|
||||
(leave (_ "'~a' import failed~%") importer)))
|
||||
(let ((print (lambda (expr)
|
||||
(pretty-print expr (newline-rewriting-port
|
||||
(current-output-port))))))
|
||||
(match (apply (resolve-importer importer) args)
|
||||
((and expr ('package _ ...))
|
||||
(print expr))
|
||||
((? list? expressions)
|
||||
(for-each (lambda (expr)
|
||||
(print expr)
|
||||
(newline))
|
||||
expressions))
|
||||
(x
|
||||
(leave (_ "'~a' import failed~%") importer))))
|
||||
(leave (_ "~a: invalid importer~%") importer)))))
|
||||
|
|
Loading…
Reference in a new issue