aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <ricardo.wurmus@mdc-berlin.de>2016-05-17 16:42:41 +0200
committerRicardo Wurmus <rekado@elephly.net>2016-12-17 19:13:41 +0100
commitd68ba5f483a42ea324ff31746fde7dcc41600463 (patch)
tree041429f768aa5704737f5990fbddcf51bf2118fa
parent64ce53eb5e8347e93574bf02e183d668c33e250c (diff)
downloadgnu-guix-d68ba5f483a42ea324ff31746fde7dcc41600463.tar
gnu-guix-d68ba5f483a42ea324ff31746fde7dcc41600463.tar.gz
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
-rw-r--r--guix/scripts/import.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
index c671686043..4d07e0fd69 100644
--- a/guix/scripts/import.scm
+++ b/guix/scripts/import.scm
@@ -107,10 +107,17 @@ Run IMPORTER with ARGS.\n"))
(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)))))