From eccb9f3f71ed67b7368bfe7a0ecea6dd784c6921 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 1 Nov 2014 12:07:09 -0700 Subject: [PATCH] Added -or and -print0 to SC2146 --- ShellCheck/Analytics.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index d7bbbc2..dab393b 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -2989,14 +2989,14 @@ prop_checkFindActionPrecedence2 = verifyNot checkFindActionPrecedence "find . -n prop_checkFindActionPrecedence3 = verifyNot checkFindActionPrecedence "find . -name '*.wav' -o -name '*.au'" checkFindActionPrecedence params = checkCommand "find" (const f) where - pattern = [isMatch, const True, isParam ["-o"], isMatch, const True, isAction] + pattern = [isMatch, const True, isParam ["-o", "-or"], isMatch, const True, isAction] f list | length list < length pattern = return () f list@(_:rest) = if all id (zipWith ($) pattern list) then warnFor (list !! ((length pattern)-1)) else f rest - isMatch = isParam [ "-name", "-regex", "-iname", "-iregex" ] - isAction = isParam [ "-exec", "-execdir", "-delete", "-print" ] + isMatch = isParam [ "-name", "-regex", "-iname", "-iregex", "-wholename", "-iwholename" ] + isAction = isParam [ "-exec", "-execdir", "-delete", "-print", "-print0" ] isParam strs t = fromMaybe False $ do param <- getLiteralString t return $ param `elem` strs