mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
getopt-long cleanup
* module/ice-9/getopt-long.scm (looks-like-an-option): Remove obtuse use of "some".
This commit is contained in:
parent
88c9420c15
commit
8b9b0af445
1 changed files with 4 additions and 6 deletions
|
@ -157,7 +157,7 @@
|
|||
;;; Code:
|
||||
|
||||
(define-module (ice-9 getopt-long)
|
||||
#:use-module ((ice-9 common-list) #:select (some remove-if-not))
|
||||
#:use-module ((ice-9 common-list) #:select (remove-if-not))
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
|
@ -239,11 +239,9 @@
|
|||
(cons (car opt-ls) ret-ls))))))
|
||||
|
||||
(define (looks-like-an-option string)
|
||||
(some (lambda (rx)
|
||||
(regexp-exec rx string))
|
||||
`(,short-opt-rx
|
||||
,long-opt-with-value-rx
|
||||
,long-opt-no-value-rx)))
|
||||
(or (regexp-exec short-opt-rx string)
|
||||
(regexp-exec long-opt-with-value-rx string)
|
||||
(regexp-exec long-opt-no-value-rx string)))
|
||||
|
||||
(define (process-options specs argument-ls)
|
||||
;; Use SPECS to scan ARGUMENT-LS; return (FOUND . ETC).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue