Remove a partial pattern match equivalent to fromJust from checkFindNameGlob
This commit is contained in:
parent
c2d67c15f8
commit
440d0038aa
|
@ -197,13 +197,11 @@ prop_checkFindNameGlob1 = verify checkFindNameGlob "find / -name *.php"
|
||||||
prop_checkFindNameGlob2 = verify checkFindNameGlob "find / -type f -ipath *(foo)"
|
prop_checkFindNameGlob2 = verify checkFindNameGlob "find / -type f -ipath *(foo)"
|
||||||
prop_checkFindNameGlob3 = verifyNot checkFindNameGlob "find * -name '*.php'"
|
prop_checkFindNameGlob3 = verifyNot checkFindNameGlob "find * -name '*.php'"
|
||||||
checkFindNameGlob = CommandCheck (Basename "find") (f . arguments) where
|
checkFindNameGlob = CommandCheck (Basename "find") (f . arguments) where
|
||||||
acceptsGlob (Just s) = s `elem` [ "-ilname", "-iname", "-ipath", "-iregex", "-iwholename", "-lname", "-name", "-path", "-regex", "-wholename" ]
|
acceptsGlob s = s `elem` [ "-ilname", "-iname", "-ipath", "-iregex", "-iwholename", "-lname", "-name", "-path", "-regex", "-wholename" ]
|
||||||
acceptsGlob _ = False
|
|
||||||
f [] = return ()
|
f [] = return ()
|
||||||
f [x] = return ()
|
f [x] = return ()
|
||||||
f (a:b:r) = do
|
f (a:b:r) = do
|
||||||
when (acceptsGlob (getLiteralString a) && isGlob b) $ do
|
forM_ (getLiteralString a) $ \s -> when (acceptsGlob s && isGlob b) $
|
||||||
let (Just s) = getLiteralString a
|
|
||||||
warn (getId b) 2061 $ "Quote the parameter to " ++ s ++ " so the shell won't interpret it."
|
warn (getId b) 2061 $ "Quote the parameter to " ++ s ++ " so the shell won't interpret it."
|
||||||
f (b:r)
|
f (b:r)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue