mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
fix(cli): validation for regexp arguments
string-match-p throws an error if given an invalid regexp, which is what we *should* be testing for, not its return value (which should be ignored), but this wasn't the case before this commit. Fix: #6534
This commit is contained in:
@ -59,7 +59,7 @@ See argument types in `doom-cli-argument-types', and `defcli!' for usage.")
|
|||||||
:zshcomp "_files")
|
:zshcomp "_files")
|
||||||
(path :read expand-file-name :zshcomp "_files")
|
(path :read expand-file-name :zshcomp "_files")
|
||||||
(form :read read)
|
(form :read read)
|
||||||
(regexp :test ,(doom-rpartial #'string-match-p ""))
|
(regexp :test ,(lambda (str) (always (string-match-p str ""))))
|
||||||
(int :test "^[0-9]+$"
|
(int :test "^[0-9]+$"
|
||||||
:read string-to-number
|
:read string-to-number
|
||||||
:error "Not an integer")
|
:error "Not an integer")
|
||||||
|
Reference in New Issue
Block a user