Print usage() when pattern is invalid

This commit is contained in:
Daniel Aleksandersen 2019-02-04 12:19:52 +01:00 committed by GitHub
parent 2a1c163779
commit 11de94761a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -287,7 +287,8 @@ int main (int argc, char * argv[])
//
if(!options.reg && !check_prefix( argv[1] ))
{
std::cout << "Not correct prefix(just string)" << std::endl;
std::cout << "Invalid pattern." << std::endl;
usage();
return 1;
}else{
options.regex=std::regex(argv[1]);