Skip to content

Commit b995380

Browse files
authored
Merge pull request #5111 from zw3rk/feature/better-hidden-args
Fix Hidden Args.
2 parents 578d3a5 + 421fabd commit b995380

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Cabal/Distribution/Simple/Setup.hs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,9 +949,10 @@ copyCommand = CommandUI
949949
, "COMPONENTS [FLAGS]"
950950
]
951951
, commandDefaultFlags = defaultCopyFlags
952-
, commandOptions = \showOrParseArgs ->
953-
(filter ((`notElem` ["target-package-db"])
954-
. optionName)) $ copyOptions showOrParseArgs
952+
, commandOptions = \showOrParseArgs -> case showOrParseArgs of
953+
ShowArgs -> filter ((`notElem` ["target-package-db"])
954+
. optionName) $ copyOptions ShowArgs
955+
ParseArgs -> copyOptions ParseArgs
955956
}
956957

957958
copyOptions :: ShowOrParseArgs -> [OptionField CopyFlags]
@@ -1028,9 +1029,10 @@ installCommand = CommandUI
10281029
, commandUsage = \pname ->
10291030
"Usage: " ++ pname ++ " install [FLAGS]\n"
10301031
, commandDefaultFlags = defaultInstallFlags
1031-
, commandOptions = \showOrParseArgs ->
1032-
(filter ((`notElem` ["target-package-db"])
1033-
. optionName)) $ installOptions showOrParseArgs
1032+
, commandOptions = \showOrParseArgs -> case showOrParseArgs of
1033+
ShowArgs -> filter ((`notElem` ["target-package-db"])
1034+
. optionName) $ installOptions ShowArgs
1035+
ParseArgs -> installOptions ParseArgs
10341036
}
10351037

10361038
installOptions :: ShowOrParseArgs -> [OptionField InstallFlags]

0 commit comments

Comments
 (0)