Skip to content

Commit 8ccc0ad

Browse files
committed
Add OR logic for deprecated stackSetupYaml parser.
1 parent 23f83c0 commit 8ccc0ad

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

src/Stack/SetupCmd.hs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ data SetupCmdOpts = SetupCmdOpts
3838
, scoGHCBindistURL :: !(Maybe String)
3939
}
4040

41+
setupYamlCompatParser :: OA.Parser String
42+
setupYamlCompatParser = stackSetupYaml <|> setupInfoYaml
43+
where stackSetupYaml = OA.strOption (
44+
OA.long "stack-setup-yaml"
45+
<> OA.help "DEPRECATED: Use 'setup-info-yaml' instead"
46+
<> OA.metavar "URL"
47+
<> OA.hidden )
48+
setupInfoYaml = OA.strOption (
49+
OA.long "setup-info-yaml"
50+
<> OA.help "Alternate URL or absolute path for stack dependencies"
51+
<> OA.metavar "URL"
52+
<> OA.value defaultSetupInfoYaml )
53+
4154
setupParser :: OA.Parser SetupCmdOpts
4255
setupParser = SetupCmdOpts
4356
<$> OA.optional (OA.argument readVersion
@@ -52,11 +65,7 @@ setupParser = SetupCmdOpts
5265
"upgrade-cabal"
5366
"installing the newest version of the Cabal library globally"
5467
OA.idm
55-
<*> OA.strOption
56-
( OA.long "stack-setup-yaml"
57-
<> OA.help "Location of the main stack-setup.yaml file"
58-
<> OA.value defaultSetupInfoYaml
59-
<> OA.showDefault )
68+
<*> setupYamlCompatParser
6069
<*> OA.optional (OA.strOption
6170
(OA.long "ghc-bindist"
6271
<> OA.metavar "URL"

0 commit comments

Comments
 (0)