From 35b8d58c3ea44128a2d5b18b947195a597251648 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 2 Dec 2012 14:15:50 -0800 Subject: [PATCH] Fixed warning for [[ greplol ]] --- ShellCheck/Parser.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index e72fc68..e953fa8 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -205,8 +205,9 @@ called s p = do readConditionContents single = do readCondContents `attempting` (lookAhead $ do pos <- getPosition - choice (map (try . string) commonCommands) - parseProblemAt pos WarningC "Use 'if cmd; then ..' to check exit code, or 'if [[ $(cmd) == .. ]]' to check output.") + s <- many1 letter + when (s `elem` commonCommands) $ + parseProblemAt pos WarningC "Use 'if cmd; then ..' to check exit code, or 'if [[ $(cmd) == .. ]]' to check output.") where typ = if single then SingleBracket else DoubleBracket