Skip to content

Commit

Permalink
Make the upgrade command take all the install command flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoutts committed Jul 30, 2008
1 parent 65c37db commit 5cb6ea3
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions cabal-install/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ upgradeCommand = configureCommand {
commandDescription = Nothing,
commandUsage = usagePackages "upgrade",
commandDefaultFlags = (mempty, defaultInstallFlags),
commandOptions = \showOrParseArgs ->
liftOptionsFst (commandOptions configureCommand showOrParseArgs)
++ liftOptionsSnd [optionDryRun]
commandOptions = commandOptions installCommand
}

{-
Expand Down Expand Up @@ -226,7 +224,10 @@ installCommand = configureCommand {
commandOptions = \showOrParseArgs ->
liftOptionsFst (commandOptions configureCommand showOrParseArgs) ++
liftOptionsSnd
([ optionDryRun
([ option [] ["dry-run"]
"Do not install anything, only print what would be installed."
installDryRun (\v flags -> flags { installDryRun = v })
trueArg

, option [] ["root-cmd"]
"Command used to gain root privileges, when installing with --global."
Expand All @@ -250,13 +251,6 @@ installCommand = configureCommand {
_ -> [])
}

optionDryRun :: OptionField InstallFlags
optionDryRun =
option [] ["dry-run"]
"Do not install anything, only print what would be installed."
installDryRun (\v flags -> flags { installDryRun = v })
trueArg

instance Monoid InstallFlags where
mempty = defaultInstallFlags
mappend a b = InstallFlags {
Expand Down

0 comments on commit 5cb6ea3

Please sign in to comment.