From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.lisp.guile.bugs Subject: bug#32154: [PATCH] getopt-long: Allow digit options. Date: Sat, 14 Jul 2018 14:23:40 +0200 Message-ID: <20180714122340.3677-1-janneke@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1531570924 30445 195.159.176.226 (14 Jul 2018 12:22:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2018 12:22:04 +0000 (UTC) To: 32154@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jul 14 14:21:59 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feJYl-0007nj-G8 for guile-bugs@m.gmane.org; Sat, 14 Jul 2018 14:21:59 +0200 Original-Received: from localhost ([::1]:41230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feJas-00081T-Kl for guile-bugs@m.gmane.org; Sat, 14 Jul 2018 08:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feJam-000816-Ti for bug-guile@gnu.org; Sat, 14 Jul 2018 08:24:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feJam-0006iR-0w for bug-guile@gnu.org; Sat, 14 Jul 2018 08:24:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1feJal-0006iI-Sp for bug-guile@gnu.org; Sat, 14 Jul 2018 08:24:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1feJal-0005Km-Kk for bug-guile@gnu.org; Sat, 14 Jul 2018 08:24:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 14 Jul 2018 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32154 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.153157103220484 (code B ref -1); Sat, 14 Jul 2018 12:24:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2018 12:23:52 +0000 Original-Received: from localhost ([127.0.0.1]:59558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feJaZ-0005KK-TR for submit@debbugs.gnu.org; Sat, 14 Jul 2018 08:23:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1feJaY-0005K5-CS for submit@debbugs.gnu.org; Sat, 14 Jul 2018 08:23:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feJaS-0006Ey-G5 for submit@debbugs.gnu.org; Sat, 14 Jul 2018 08:23:45 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37532) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1feJaS-0006Ef-D4 for submit@debbugs.gnu.org; Sat, 14 Jul 2018 08:23:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feJaR-00080l-Ha for bug-guile@gnu.org; Sat, 14 Jul 2018 08:23:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1feJaQ-0006Cs-M1 for bug-guile@gnu.org; Sat, 14 Jul 2018 08:23:43 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1feJaQ-0006Ck-Ia; Sat, 14 Jul 2018 08:23:42 -0400 Original-Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=35192 helo=dundal.fritz.box) by fencepost.gnu.org with esmtpa (Exim 4.82) (envelope-from ) id 1feJaQ-0003CS-3D; Sat, 14 Jul 2018 08:23:42 -0400 X-Mailer: git-send-email 2.18.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9090 Archived-At: * module/ice-9/getopt-long.scm (short-opt-rx): Allow digits too. Allows implementing `ls -1' command line. --- module/ice-9/getopt-long.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ice-9/getopt-long.scm b/module/ice-9/getopt-long.scm index 14eaf8e23..c3e390168 100644 --- a/module/ice-9/getopt-long.scm +++ b/module/ice-9/getopt-long.scm @@ -222,7 +222,7 @@ ((string=? "--" (car no)) (cons (reverse yes) (cdr no))) (else (loop (cons (car no) yes) (cdr no)))))) -(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 "^--([^=]+)$")) (define long-opt-with-value-rx (make-regexp "^--([^=]+)=(.*)")) -- 2.18.0