GNU bug report logs - #32154
[PATCH] getopt-long: Allow digit options.

Previous Next

Package: guile;

Reported by: Jan Nieuwenhuizen <janneke <at> gnu.org>

Date: Sat, 14 Jul 2018 12:24:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 32154 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#32154; Package guile. (Sat, 14 Jul 2018 12:24:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Nieuwenhuizen <janneke <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sat, 14 Jul 2018 12:24:03 GMT) Full text and rfc822 format available.

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

From: Jan Nieuwenhuizen <janneke <at> gnu.org>
To: bug-guile <at> gnu.org
Subject: [PATCH] getopt-long: Allow digit options.
Date: Sat, 14 Jul 2018 14:23:40 +0200
* 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





Information forwarded to bug-guile <at> gnu.org:
bug#32154; Package guile. (Mon, 18 May 2020 10:10:01 GMT) Full text and rfc822 format available.

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

From: Dale Mellor <guile-qf1qmg <at> rdmp.org>
To: 32154 <at> debbugs.gnu.org
Subject: This patch breaks tests and is irrelevant now
Date: Mon, 18 May 2020 11:09:11 +0100
Note that this patch breaks an existing test (since 2001), namely

(option-ref (getopt-long
              (list "prog" "-f4")
              '((foo
                 (value optional)
                 (single-char #\f))
                (bar)))
             'foo #f)

bails out with 

prog: no such option: -4


The only way to deal with this is to give getopt-long more intelligence in determining where command-line arguments are option
values or otherwise; this is the subject of #40719 which also allows numerical short options, but doesn't break the test suite.

My suggestion would be to dismiss (close) this bug report at this time.






Information forwarded to bug-guile <at> gnu.org:
bug#32154; Package guile. (Sun, 02 Aug 2020 10:52:01 GMT) Full text and rfc822 format available.

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

From: Dale Mellor <guile-qf1qmg <at> rdmp.org>
To: 32154 <32154 <at> debbugs.gnu.org>
Subject: This issue is now dealt with by #42669
Date: Sun, 02 Aug 2020 11:51:18 +0100


This bug report was last modified 4 years and 315 days ago.

Previous Next


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