guix-patches
[Top][All Lists]
Advanced

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

[bug#30303] [PATCH] linux-boot: Add find-long-options.


From: Ludovic Courtès
Subject: [bug#30303] [PATCH] linux-boot: Add find-long-options.
Date: Wed, 31 Jan 2018 23:41:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Danny Milosavljevic <address@hidden> skribis:

> * gnu/build/linux/boot.scm (find-long-options): New variable.

[...]

> +(define (find-long-options option arguments)
> +  "Find OPTIONs among ARGUMENTS, where OPTION is something like \"console\".
> +Return the values associated with OPTIONs as a list, or the empty list on
> +failure."

s/on failure/if OPTION doesn't appear in ARGUMENTS/

> +  (let ((opt (string-append option "=")))
> +    (map (lambda (arg)
> +           (substring arg (+ 1 (string-index arg #\=))))
> +         (filter
> +           (lambda (arg)
> +             (string-prefix? opt arg))
> +         arguments))))

You can make it:

  (filter-map (lambda (arg)
                (and (string-prefix? opt arg)
                     (substring …)))
              arguments)

OK with these changes, thanks!  :-)

Ludo’.





reply via email to

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