guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: guix download: Gracefully handle missing arguments.


From: Ludovic Courtès
Subject: 01/04: guix download: Gracefully handle missing arguments.
Date: Mon, 23 Nov 2015 16:48:43 +0000

civodul pushed a commit to branch master
in repository guix.

commit 71ae18ee52757eb60be50bb2e50bab5e84d0f097
Author: Ludovic Courtès <address@hidden>
Date:   Mon Nov 23 17:32:02 2015 +0100

    guix download: Gracefully handle missing arguments.
    
    Fixes <http://bugs.gnu.org/21991>.
    Reported by Jan SynáÄek <address@hidden>.
    
    * guix/scripts/download.scm (guix-download): Call 'leave' when OPTS does
    not contain an 'argument' key.
---
 guix/scripts/download.scm |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/download.scm b/guix/scripts/download.scm
index 533970f..b81295e 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 <address@hidden>
+;;; Copyright © 2012, 2013, 2015 Ludovic Courtès <address@hidden>
 ;;;
 ;;; 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]