mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
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.
This commit is contained in:
parent
bbee7bd765
commit
71ae18ee52
1 changed files with 3 additions and 2 deletions
|
@ -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 @@ (define (parse-options)
|
|||
(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)))
|
||||
|
|
Loading…
Reference in a new issue