mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-24 14:18:07 +08:00
Get rid of our getOpt, as it already exists as lookup
This commit is contained in:
@@ -2840,7 +2840,7 @@ checkReadWithoutR _ t@T_SimpleCommand {} | t `isUnqualifiedCommand` "read" =
|
|||||||
flags = getAllFlags t
|
flags = getAllFlags t
|
||||||
has_t0 = fromMaybe False $ do
|
has_t0 = fromMaybe False $ do
|
||||||
parsed <- getOpts flagsForRead flags
|
parsed <- getOpts flagsForRead flags
|
||||||
t <- getOpt "t" parsed
|
t <- lookup "t" parsed
|
||||||
str <- getLiteralString t
|
str <- getLiteralString t
|
||||||
return $ str == "0"
|
return $ str == "0"
|
||||||
|
|
||||||
|
@@ -960,8 +960,6 @@ getOpts string flags = process flags
|
|||||||
more <- process rest2
|
more <- process rest2
|
||||||
return $ (flag1, token1) : more
|
return $ (flag1, token1) : more
|
||||||
|
|
||||||
getOpt str flags = snd <$> (listToMaybe $ filter (\(f, _) -> f == str) $ flags)
|
|
||||||
|
|
||||||
supportsArrays shell = shell == Bash || shell == Ksh
|
supportsArrays shell = shell == Bash || shell == Ksh
|
||||||
|
|
||||||
-- Returns true if the shell is Bash or Ksh (sorry for the name, Ksh)
|
-- Returns true if the shell is Bash or Ksh (sorry for the name, Ksh)
|
||||||
|
Reference in New Issue
Block a user