Don't warn about echo "--------" is posix mode

This commit is contained in:
Vidar Holen 2013-07-23 21:40:55 -07:00
parent 6974497f45
commit 1784972af7
1 changed files with 4 additions and 2 deletions

View File

@ -398,8 +398,10 @@ checkBashisms = bashism
when (isJust $ matchRegex regex str) $ warnMsg id feature
bashism t@(T_SimpleCommand _ _ (cmd:arg:_))
| t `isCommand` "echo" && "-" `isPrefixOf` (concat $ deadSimple arg) =
| t `isCommand` "echo" && "-" `isPrefixOf` argString =
when (not $ "--" `isPrefixOf` argString) $ -- echo "-------"
warnMsg (getId arg) "echo flag"
where argString = (concat $ deadSimple arg)
bashism t@(T_SimpleCommand _ _ (cmd:arg:_))
| t `isCommand` "exec" && "-" `isPrefixOf` (concat $ deadSimple arg) =
warnMsg (getId arg) "exec flag"