Skip to content

Commit 0607039

Browse files
committed
Simplify actualArgs
1 parent 46f177b commit 0607039

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ShellCheck/Checks/Commands.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ checkGetOpts str flags args f =
122122
toTokens = map (T_Literal (Id 0)) . words
123123
opts = fromMaybe [] $ f (toTokens str)
124124
actualFlags = filter (not . null) $ map fst opts
125-
actualArgs = map (\(_, (_, x)) -> onlyLiteralString x) $ filter (null . fst) opts
125+
actualArgs = [onlyLiteralString x | ("", (_, x)) <- opts]
126126

127127
-- Short options
128128
prop_checkGetOptsS1 = checkGetOpts "-f x" ["f"] [] $ getOpts (True, True) "f:" []

0 commit comments

Comments
 (0)