scripts: publish: Replace 'args-fold*' by 'parse-command-line'.

* guix/scripts/publish.scm (define-command): Replace 'args-fold*' by
'parse-command-line'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
zimoun 2021-03-29 12:18:03 +02:00 committed by Ludovic Courtès
parent f4070b153d
commit ec3090e0c2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

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