unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* 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	[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

unofficial mirror of bug-guile@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-bugs/0 guile-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-bugs guile-bugs/ https://yhetil.org/guile-bugs \
		bug-guile@gnu.org
	public-inbox-index guile-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.bugs
	nntp://news.gmane.io/gmane.lisp.guile.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git