ambrevar/shell: Add match-name.
parent
2f6df66930
commit
a122e66ece
|
@ -37,6 +37,16 @@ Useful for `finder'."
|
||||||
(string= ext (pathname-type file)))
|
(string= ext (pathname-type file)))
|
||||||
(cons extension more-extensions))))
|
(cons extension more-extensions))))
|
||||||
|
|
||||||
|
(export-always 'match-name)
|
||||||
|
(defun match-name (name &rest more-names)
|
||||||
|
"Return a predicate that matches when one of the names is contained in the
|
||||||
|
file basename.
|
||||||
|
Basename includes the extension. Useful for `finder'."
|
||||||
|
(lambda (file)
|
||||||
|
(some (lambda (name)
|
||||||
|
(str:contains? name (file-basename file)))
|
||||||
|
(cons name more-names))))
|
||||||
|
|
||||||
(export-always 'match-directory)
|
(export-always 'match-directory)
|
||||||
(defun match-directory (&key (empty? t) (non-empty? t) (files? t))
|
(defun match-directory (&key (empty? t) (non-empty? t) (files? t))
|
||||||
"Return a predicate that matches on directories.
|
"Return a predicate that matches on directories.
|
||||||
|
|
Loading…
Reference in New Issue