* bug#32154: [PATCH] getopt-long: Allow digit options.
@ 2018-07-14 12:23 Jan Nieuwenhuizen
2020-05-18 10:09 ` bug#32154: This patch breaks tests and is irrelevant now Dale Mellor
2020-08-02 10:51 ` bug#32154: This issue is now dealt with by #42669 Dale Mellor
0 siblings, 2 replies; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2018-07-14 12:23 UTC (permalink / raw)
To: 32154
* 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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#32154: This patch breaks tests and is irrelevant now
2018-07-14 12:23 bug#32154: [PATCH] getopt-long: Allow digit options Jan Nieuwenhuizen
@ 2020-05-18 10:09 ` Dale Mellor
2020-08-02 10:51 ` bug#32154: This issue is now dealt with by #42669 Dale Mellor
1 sibling, 0 replies; 3+ messages in thread
From: Dale Mellor @ 2020-05-18 10:09 UTC (permalink / raw)
To: 32154
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#32154: This issue is now dealt with by #42669
2018-07-14 12:23 bug#32154: [PATCH] getopt-long: Allow digit options Jan Nieuwenhuizen
2020-05-18 10:09 ` bug#32154: This patch breaks tests and is irrelevant now Dale Mellor
@ 2020-08-02 10:51 ` Dale Mellor
1 sibling, 0 replies; 3+ messages in thread
From: Dale Mellor @ 2020-08-02 10:51 UTC (permalink / raw)
To: 32154
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-02 10:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-14 12:23 bug#32154: [PATCH] getopt-long: Allow digit options Jan Nieuwenhuizen
2020-05-18 10:09 ` bug#32154: This patch breaks tests and is irrelevant now Dale Mellor
2020-08-02 10:51 ` bug#32154: This issue is now dealt with by #42669 Dale Mellor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).