diff options
author | Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> | 2016-05-17 16:42:41 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2016-12-17 19:13:41 +0100 |
commit | d68ba5f483a42ea324ff31746fde7dcc41600463 (patch) | |
tree | 041429f768aa5704737f5990fbddcf51bf2118fa | |
parent | 64ce53eb5e8347e93574bf02e183d668c33e250c (diff) | |
download | guix-d68ba5f483a42ea324ff31746fde7dcc41600463.tar.gz guix-d68ba5f483a42ea324ff31746fde7dcc41600463.zip |
guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
-rw-r--r-- | guix/scripts/import.scm | 19 |
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))))) |