GNU bug report logs - #47464
[PATCH 0/8] scripts: Allow option hint for various subcommands.

Previous Next

Package: guix-patches;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Mon, 29 Mar 2021 10:17:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 47464 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: 47464 <at> debbugs.gnu.org
Cc: zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH 5/8] scripts: publish: Replace 'args-fold*' by
 'parse-command-line'.
Date: Mon, 29 Mar 2021 12:18:03 +0200
* guix/scripts/publish.scm (define-command): Replace 'args-fold*' by
'parse-command-line'.
---
 guix/scripts/publish.scm | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index fa85088ed0..39bb224cad 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2020 by Amar M. Singh <nly <at> disroot.org>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1117,12 +1118,11 @@ methods, return the applicable compression."
   (synopsis "publish build results over HTTP")
 
   (with-error-handling
-    (let* ((opts    (args-fold* args %options
-                                (lambda (opt name arg result)
-                                  (leave (G_ "~A: unrecognized option~%") name))
-                                (lambda (arg result)
-                                  (leave (G_ "~A: extraneous argument~%") arg))
-                                %default-options))
+    (let* ((opts    (parse-command-line args %options (list %default-options)
+                                        #:build-options? #f
+                                        #:argument-handler
+                                        (lambda (arg result)
+                                          (leave (G_ "~A: extraneous argument~%") arg))))
            (advertise?  (assoc-ref opts 'advertise?))
            (user        (assoc-ref opts 'user))
            (port        (assoc-ref opts 'port))
-- 
2.30.1





This bug report was last modified 4 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.