From 84934f40d13ab7ad6f22703acbc5272954e2e0f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 5 Nov 2014 18:04:16 +0100 Subject: [PATCH] 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(-) 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 @@ Import and convert the PyPI package for PACKAGE-NAME.\n")) (unless sexp (leave (_ "failed to download meta-data for package '~a'~%") package-name)) - sexp))))) + sexp)) + (() + (leave (_ "too few arguments~%"))) + ((many ...) + (leave (_ "too many arguments~%"))))))