From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh14w-0004ze-Cj for guix-patches@gnu.org; Wed, 31 Jan 2018 17:42:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh14s-0002oY-Gq for guix-patches@gnu.org; Wed, 31 Jan 2018 17:42:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:43702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eh14s-0002nX-DH for guix-patches@gnu.org; Wed, 31 Jan 2018 17:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eh14s-0001lI-1O for guix-patches@gnu.org; Wed, 31 Jan 2018 17:42:02 -0500 Subject: [bug#30303] [PATCH] linux-boot: Add find-long-options. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180131122933.6051-1-dannym@scratchpost.org> Date: Wed, 31 Jan 2018 23:41:05 +0100 In-Reply-To: <20180131122933.6051-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Wed, 31 Jan 2018 13:29:33 +0100") Message-ID: <87po5pr6ri.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 30303@debbugs.gnu.org Danny Milosavljevic 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 \"consol= e\". > +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 "=3D"))) > + (map (lambda (arg) > + (substring arg (+ 1 (string-index arg #\=3D)))) > + (filter > + (lambda (arg) > + (string-prefix? opt arg)) > + arguments)))) You can make it: (filter-map (lambda (arg) (and (string-prefix? opt arg) (substring =E2=80=A6))) arguments) OK with these changes, thanks! :-) Ludo=E2=80=99.