From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Janneke Nieuwenhuizen Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] getopt-long permits numbers for short options. Date: Tue, 05 Sep 2023 08:25:48 +0200 Organization: AvatarAcademy.nl Message-ID: <87fs3txhjn.fsf@gnu.org> References: <20230905060454.16247-1-marius@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19576"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cc: guile-devel@gnu.org To: Marius Bakke Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Sep 05 08:26:32 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdPW9-0004mN-2r for guile-devel@m.gmane-mx.org; Tue, 05 Sep 2023 08:26:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdPVj-0008IW-Qw; Tue, 05 Sep 2023 02:26:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPVe-0008ID-J1 for guile-devel@gnu.org; Tue, 05 Sep 2023 02:25:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPVb-0000Qj-Rg; Tue, 05 Sep 2023 02:25:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=/EBoPys7cT1hKM5isjP2G0si99AccFnsmltF2YqJUSY=; b=JgKRu4oPkOOjuPE/ML/d 5rdvNlDqfsnf7eXgXQZCjl4tdlRQze0nT7RNd0MCgXRn8TuVS8P1etUC7LBHFLgt2ZBNM0Ph9wxSh k6bYM+JMjhPQTxFfGjVbnTp5dE1qGD1T7F5hkV05f4X/L3J7i3+zGZgzrmZKxQodkUugMb+cFh28I 9IA/eIbqUWrqGg3qovhFguQLE3XTXa1d+rRehrnykB7HhtvwQalqdwj7L3R40g8Mf9XyklGdAgSR+ tKLendFUsDae7DtcfxADhgl/UmsXXn4zNv303Oapu1i6XKrcHLDNx5po0PObRAIqSH/1Uj3lDgMq+ vWxXRgDH8xbWXQ==; X-Url: http://AvatarAcademy.nl In-Reply-To: <20230905060454.16247-1-marius@gnu.org> (Marius Bakke's message of "Tue, 5 Sep 2023 14:04:54 +0800") X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21941 Archived-At: Marius Bakke writes: > * module/ice-9/getopt-long.scm (short-opt-rx): Add 0-9. Hehe, reminds me of https://lists.gnu.org/archive/html/bug-guile/2018-07/msg00009.html > diff --git a/module/ice-9/getopt-long.scm b/module/ice-9/getopt-long.scm > index 18b235390..0077183da 100644 > --- a/module/ice-9/getopt-long.scm > +++ b/module/ice-9/getopt-long.scm > @@ -221,7 +221,7 @@ > ((string=3D? "--" (car no)) (cons (reverse yes) (cdr no))) > (else (loop (cons (car no) yes) (cdr no)))))) >=20=20 > -(define short-opt-rx (make-regexp "^-([a-zA-Z]+)(.*)")) > +(define short-opt-rx (make-regexp "^-([a-zA-Z0-9]+)(.*)")) > (define long-opt-no-value-rx (make-regexp "^--([^=3D]+)$")) > (define long-opt-with-value-rx (make-regexp "^--([^=3D]+)=3D(.*)")) FWIW, LGTM :) Greetings, Janneke --=20 Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade= my.com