From cbe3b72d151ac5315725f7c4165b14ca8f72d455 Mon Sep 17 00:00:00 2001 From: Albert Wolszon Date: Tue, 24 Oct 2023 10:43:05 +0200 Subject: [PATCH] Fix term-prefix validation --- cmd/poe.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/poe.go b/cmd/poe.go index ad9d9b7..d9b2e7a 100644 --- a/cmd/poe.go +++ b/cmd/poe.go @@ -25,7 +25,7 @@ var ( SilenceUsage: true, RunE: runPoe, } - termPrefixRegexp = regexp.MustCompile("[a-z]*") + termPrefixRegexp = regexp.MustCompile("[a-zA-Z]*") ) const ( @@ -160,8 +160,8 @@ func validatePoeOptions(options *poeOptions) []error { errs = append(errs, errors.New("no POEditor API token provided")) } - if termPrefixRegexp.MatchString(options.TermPrefix) { - errs = append(errs, errors.New("term prefix must contain only lowercase letters or be empty")) + if !termPrefixRegexp.MatchString(options.TermPrefix) { + errs = append(errs, errors.New("term prefix must contain only letters or be empty")) } return errs