Skip to content

Commit 1e90ae4

Browse files
committed
Use default flags rather than mempty.
In particular, the Cmd* modules don't mappend in the defaults before using the flags, so ensuring they're setup correctly from the start helps avoid errors. This default flag business is extremely dodgy and I wish we had a better story for it. Signed-off-by: Edward Z. Yang <[email protected]>
1 parent adc483c commit 1e90ae4

File tree

1 file changed

+8
-2
lines changed
  • cabal-install/Distribution/Client

1 file changed

+8
-2
lines changed

cabal-install/Distribution/Client/Setup.hs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,10 @@ upgradeCommand = configureCommand {
10461046
commandSynopsis = "(command disabled, use install instead)",
10471047
commandDescription = Nothing,
10481048
commandUsage = usageFlagsOrPackages "upgrade",
1049-
commandDefaultFlags = (mempty, mempty, mempty, mempty),
1049+
commandDefaultFlags = (commandDefaultFlags configureCommand,
1050+
defaultConfigExFlags,
1051+
defaultInstallFlags,
1052+
Cabal.defaultHaddockFlags),
10501053
commandOptions = commandOptions installCommand
10511054
}
10521055

@@ -1553,7 +1556,10 @@ installCommand = CommandUI {
15531556
++ " " ++ (map (const ' ') pname)
15541557
++ " "
15551558
++ " Change installation destination\n",
1556-
commandDefaultFlags = (mempty, mempty, mempty, mempty),
1559+
commandDefaultFlags = (commandDefaultFlags configureCommand,
1560+
defaultConfigExFlags,
1561+
defaultInstallFlags,
1562+
Cabal.defaultHaddockFlags),
15571563
commandOptions = \showOrParseArgs ->
15581564
liftOptions get1 set1
15591565
(filter ((`notElem` ["constraint", "dependency"

0 commit comments

Comments
 (0)