Update getFlag function to also return non-flags.

This commit is contained in:
Vidar Holen
2015-10-27 22:07:29 -07:00
parent ffb9578a98
commit 48fd793581
2 changed files with 9 additions and 5 deletions

View File

@@ -689,7 +689,8 @@ checkBashisms params = bashism
warnMsg id $ "'" ++ name ++ "' is"
potentially $ do
allowed <- Map.lookup name allowedFlags
(word, flag) <- listToMaybe $ filter (\x -> snd x `notElem` allowed) flags
(word, flag) <- listToMaybe $
filter (\x -> (not . null . snd $ x) && snd x `notElem` allowed) flags
return . warnMsg (getId word) $ name ++ " -" ++ flag ++ " is"
when (name == "source") $ warnMsg id "'source' in place of '.' is"