mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-25 01:47:42 +08:00
Simplify actualArgs
This commit is contained in:
@@ -122,7 +122,7 @@ checkGetOpts str flags args f =
|
|||||||
toTokens = map (T_Literal (Id 0)) . words
|
toTokens = map (T_Literal (Id 0)) . words
|
||||||
opts = fromMaybe [] $ f (toTokens str)
|
opts = fromMaybe [] $ f (toTokens str)
|
||||||
actualFlags = filter (not . null) $ map fst opts
|
actualFlags = filter (not . null) $ map fst opts
|
||||||
actualArgs = map (\(_, (_, x)) -> onlyLiteralString x) $ filter (null . fst) opts
|
actualArgs = [onlyLiteralString x | ("", (_, x)) <- opts]
|
||||||
|
|
||||||
-- Short options
|
-- Short options
|
||||||
prop_checkGetOptsS1 = checkGetOpts "-f x" ["f"] [] $ getOpts (True, True) "f:" []
|
prop_checkGetOptsS1 = checkGetOpts "-f x" ["f"] [] $ getOpts (True, True) "f:" []
|
||||||
|
Reference in New Issue
Block a user