s/range/class/ when warning about tr '[abc]'

This commit is contained in:
Vidar Holen 2016-07-05 08:51:40 -07:00
parent 6dc419bbf5
commit 36263fb3f5
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ checkTr = CommandCheck (Basename "tr") (mapM_ f . arguments)
info (getId word) 2020 "tr replaces sets of chars, not words (mentioned due to duplicates)."
unless ("[:" `isPrefixOf` s) $
when ("[" `isPrefixOf` s && "]" `isSuffixOf` s && (length s > 2) && ('*' `notElem` s)) $
info (getId word) 2021 "Don't use [] around ranges in tr, it replaces literal square brackets."
info (getId word) 2021 "Don't use [] around classes in tr, it replaces literal square brackets."
Nothing -> return ()
duplicated s =