mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Simplify isUnquotedFlag
This commit is contained in:
parent
5a6f4840ad
commit
025cc5266e
1 changed files with 4 additions and 3 deletions
|
@ -158,9 +158,10 @@ isFlag token =
|
||||||
_ -> False
|
_ -> False
|
||||||
|
|
||||||
-- Is this token a flag where the - is unquoted?
|
-- Is this token a flag where the - is unquoted?
|
||||||
isUnquotedFlag token = fromMaybe False $ do
|
isUnquotedFlag token =
|
||||||
str <- getLeadingUnquotedString token
|
case getLeadingUnquotedString token of
|
||||||
return $ "-" `isPrefixOf` str
|
Just ('-':_) -> True
|
||||||
|
_ -> False
|
||||||
|
|
||||||
-- getGnuOpts "erd:u:" will parse a list of arguments tokens like `read`
|
-- getGnuOpts "erd:u:" will parse a list of arguments tokens like `read`
|
||||||
-- -re -d : -u 3 bar
|
-- -re -d : -u 3 bar
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue