Merge pull request #1468 from Gandalf-/issue_824_grep_fixed_strings

Issue 824 grep fixed strings and SC2063
This commit is contained in:
Vidar Holen 2019-01-20 14:06:40 -08:00 committed by GitHub
commit a03d94c0b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -212,6 +212,7 @@ prop_checkGrepRe16= verifyNot checkGrepRe "grep --include 'Foo*' file"
prop_checkGrepRe17= verifyNot checkGrepRe "grep --exclude 'Foo*' file"
prop_checkGrepRe18= verifyNot checkGrepRe "grep --exclude-dir 'Foo*' file"
prop_checkGrepRe19= verify checkGrepRe "grep -- 'Foo*' file"
prop_checkGrepRe20= verifyNot checkGrepRe "grep --fixed-strings 'Foo*' file"
checkGrepRe = CommandCheck (Basename "grep") check where
check cmd = f cmd (arguments cmd)
@ -244,7 +245,7 @@ checkGrepRe = CommandCheck (Basename "grep") check where
"Note that unlike globs, " ++ [char] ++ "* here matches '" ++ [char, char, char] ++ "' but not '" ++ wordStartingWith char ++ "'."
where
flags = map snd $ getAllFlags cmd
grepGlobFlags = ["F", "include", "exclude", "exclude-dir"]
grepGlobFlags = ["fixed-strings", "F", "include", "exclude", "exclude-dir"]
wordStartingWith c =
head . filter ([c] `isPrefixOf`) $ candidates