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:
parent
acae9f9acb
commit
cd8fb0059d
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ See argument types in `doom-cli-argument-types', and `defcli!' for usage.")
|
|||
:zshcomp "_files")
|
||||
(path :read expand-file-name :zshcomp "_files")
|
||||
(form :read read)
|
||||
(regexp :test ,(doom-rpartial #'string-match-p ""))
|
||||
(regexp :test ,(lambda (str) (always (string-match-p str ""))))
|
||||
(int :test "^[0-9]+$"
|
||||
:read string-to-number
|
||||
:error "Not an integer")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue