Simplify isUnquotedFlag

This commit is contained in:
Joseph C. Sible 2024-01-01 16:00:19 -05:00
parent 5a6f4840ad
commit 025cc5266e
1 changed files with 4 additions and 3 deletions

View File

@ -158,9 +158,10 @@ isFlag token =
_ -> False
-- Is this token a flag where the - is unquoted?
isUnquotedFlag token = fromMaybe False $ do
str <- getLeadingUnquotedString token
return $ "-" `isPrefixOf` str
isUnquotedFlag token =
case getLeadingUnquotedString token of
Just ('-':_) -> True
_ -> False
-- getGnuOpts "erd:u:" will parse a list of arguments tokens like `read`
-- -re -d : -u 3 bar