From 84934f40d13ab7ad6f22703acbc5272954e2e0f8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 5 Nov 2014 18:04:16 +0100 Subject: import: pypi: Gracefully handle wrong argument counts. * guix/scripts/import/pypi.scm (guix-import-pypi): Use 'leave' to handle cases where ARGS has zero or two or more elements. --- guix/scripts/import/pypi.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix/scripts/import') diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm index a36065e5cf..1e03843840 100644 --- a/guix/scripts/import/pypi.scm +++ b/guix/scripts/import/pypi.scm @@ -84,4 +84,8 @@ (define (parse-options) (unless sexp (leave (_ "failed to download meta-data for package '~a'~%") package-name)) - sexp))))) + sexp)) + (() + (leave (_ "too few arguments~%"))) + ((many ...) + (leave (_ "too many arguments~%")))))) -- cgit v1.2.3