From 34690ad3db528842452ad23192c8962bdf4f688c Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Mon, 26 Nov 2012 22:23:40 -0800 Subject: [PATCH] Added more helpful message for 'if [ grep .. ]' --- ShellCheck/Parser.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index e216c9a..335f2a2 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -166,7 +166,7 @@ readConditionContents single = do readCondContents `attempting` (lookAhead $ do pos <- getPosition choice (map (try . string) commonCommands) - parseProblemAt pos WarningC "To check a command, skip [] and just do 'if foo | grep bar; then'.") + 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