GNU bug report logs - #64173
[PATCH 0/1] guix: pack: add --entry-point-argument option

Previous Next

Package: guix-patches;

Reported by: Graham James Addis <grahamjamesaddis <at> gmail.com>

Date: Mon, 19 Jun 2023 15:39:02 UTC

Severity: normal

Tags: patch

Merged with 64171

Full log


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

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, Graham James Addis
 <grahamjamesaddis <at> gmail.com>
Cc: Graham James Addis <graham <at> addis.org.uk>, Josselin Poiret <dev <at> jpoiret.xyz>,
 Christopher Baines <mail <at> cbaines.net>, 64173 <at> debbugs.gnu.org,
 Mathieu Othacehe <othacehe <at> gnu.org>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 64171 <at> debbugs.gnu.org, Ricardo Wurmus <rekado <at> elephly.net>
Subject: Re: [bug#64173] [PATCH 0/1] guix: pack: add --entry-point-argument
 option
Date: Thu, 17 Aug 2023 13:48:33 +0200
Hi,

On Thu, 17 Aug 2023 at 11:42, Ludovic Courtès <ludo <at> gnu.org> wrote:

>> +(define (entry-point-argument-spec-option-parser opt name arg result)
>> +  "A SRFI-37 opion parser for the --entry-point-argument option. The spec
>> +takes multiple occurances. The entries are used in the exec form for the
>> +docker entry-point. The values are used as parameters in conjunction with
>> +the --entry-point option which is used as the first value in the exec form."
>> +  (let ((entry-point-argument (assoc-ref result 'entry-point-argument)))
>> +    (alist-cons 'entry-point-argument
>> +                (append entry-point-argument (list arg))
>> +                (alist-delete 'entry-point-argument result eq?))))
>
> I would just keep a regular option parser that does:
>
>   (alist-cons 'entry-point-argument arg result)
>
> Later on, we’d collect all these arguments:
>
>   (reverse
>    (filter-map (match-lambda
>                 (('entry-point-argument . arg) arg)
>                 (_ #f))
>                opts))
>
> I think this would be a bit clearer; this is what ‘guix repl’ does, for
> instance.

[...]

> This can be omitted if you take the approach suggested above, with one
> ‘entry-point-argument’ pair per argument.

[...]

> This would become #:entry-point-arguments (plural), with the
> ‘filter-map’ trick shown above.

Just to be sure to understand, the command-line could list several
--entry-point-argument options, right?

Well, since the order of the various command-line arguments might
matter, and since a ’reverse’ is suggested, and since all the Guix
command-lines do not behave the same way – for instance “guix package”
processes command-line argument from right to left; see #43585 or #50473
[1,2]; anyway :-) – I would suggest to add a sentence in the
documentation (manual) that the command-line arguments are parsed from
left to right.


1: https://issues.guix.gnu.org/issue/43585
2: https://issues.guix.gnu.org/issue/50473


Cheers,
simon




This bug report was last modified 1 year and 177 days ago.

Previous Next


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