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.
master
Ludovic Courtès 2014-11-05 18:04:16 +01:00
parent 467a3c93db
commit 84934f40d1
1 changed files with 5 additions and 1 deletions

View File

@ -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~%"))))))