GNU bug report logs - #49780
[PATCH 00/14] import: Use PARSE-COMMAND-LINE for options.

Previous Next

Package: guix-patches;

Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>

Date: Fri, 30 Jul 2021 03:52: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 #35 received at 49780 <at> debbugs.gnu.org (full text, mbox):

From: Sarah Morgensen <iskarian <at> mgsn.dev>
To: 49780 <at> debbugs.gnu.org
Subject: [PATCH 10/14] import: pypi: Use PARSE-COMMAND-LINE for options.
Date: Thu, 29 Jul 2021 20:55:06 -0700
guix/scripts/import/pypi.scm (guix-import-pypi)[parse-options]: Use
PARSE-COMMAND-LINE instead of ARGS-FOLD*.
---
 guix/scripts/import/pypi.scm | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm
index 33167174e2..9170a0b359 100644
--- a/guix/scripts/import/pypi.scm
+++ b/guix/scripts/import/pypi.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014 David Thompson <davet <at> gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2021 Sarah Morgensen <iskarian <at> mgsn.dev>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -72,12 +73,8 @@ Import and convert the PyPI package for PACKAGE-NAME.\n"))
 (define (guix-import-pypi . args)
   (define (parse-options)
     ;; Return the alist of option values.
-    (args-fold* args %options
-                (lambda (opt name arg result)
-                  (leave (G_ "~A: unrecognized option~%") name))
-                (lambda (arg result)
-                  (alist-cons 'argument arg result))
-                %default-options))
+    (parse-command-line args %options (list %default-options)
+                        #:build-options? #f))
 
   (let* ((opts (parse-options))
          (args (filter-map (match-lambda
-- 
2.31.1





This bug report was last modified 3 years and 323 days ago.

Previous Next


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