Skip command argument when checking trap signal specs (#946)

This commit is contained in:
Vidar Holen
2017-07-03 10:36:51 -07:00
parent a06ad41bfa
commit 8f31ae913b
2 changed files with 10 additions and 1 deletions

View File

@@ -119,6 +119,11 @@ getLeadingFlags = getFlagsUntil (\x -> x == "--" || (not $ "-" `isPrefixOf` x))
-- Check if a command has a flag.
hasFlag cmd str = str `elem` (map snd $ getAllFlags cmd)
-- Is this token a word that starts with a dash?
isFlag token =
case getWordParts token of
T_Literal _ ('-':_) : _ -> True
_ -> False
-- Given a T_DollarBraced, return a simplified version of the string contents.
bracedString (T_DollarBraced _ l) = concat $ oversimplify l