aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-11-23 17:32:02 +0100
committerLudovic Courtès <ludo@gnu.org>2015-11-23 17:48:35 +0100
commit71ae18ee52757eb60be50bb2e50bab5e84d0f097 (patch)
tree5a74396d08e37c07ece79032ed469de23762366f
parentbbee7bd765413138767d450680e20d3b3e2f7f78 (diff)
downloadpatches-71ae18ee52757eb60be50bb2e50bab5e84d0f097.tar
patches-71ae18ee52757eb60be50bb2e50bab5e84d0f097.tar.gz
guix download: Gracefully handle missing arguments.
Fixes <http://bugs.gnu.org/21991>. Reported by Jan Synáček <jan.synacek@gmail.com>. * guix/scripts/download.scm (guix-download): Call 'leave' when OPTS does not contain an 'argument' key.
-rw-r--r--guix/scripts/download.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/scripts/download.scm b/guix/scripts/download.scm
index 533970ffbb..b81295e5d9 100644
--- a/guix/scripts/download.scm
+++ b/guix/scripts/download.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -102,7 +102,8 @@ Supported formats: 'nix-base32' (default), 'base32', and 'base16'
(with-error-handling
(let* ((opts (parse-options))
(store (open-connection))
- (arg (assq-ref opts 'argument))
+ (arg (or (assq-ref opts 'argument)
+ (leave (_ "no download URI was specified~%"))))
(uri (or (string->uri arg)
(leave (_ "~a: failed to parse URI~%")
arg)))