Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add entry for 3.0 to init script #6240

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cabal-install/Distribution/Client/Init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ displayCabalVersion v = case versionNumbers v of
[2,0] -> "2.0 (+ support for Backpack, internal sub-libs, '^>=' operator)"
[2,2] -> "2.2 (+ support for 'common', 'elif', redundant commas, SPDX)"
[2,4] -> "2.4 (+ support for '**' globbing)"
[3,0] -> "3.0 (+ support for set-notation syntax for '==' and '^>=')"
_ -> display v

-- | Ask if a simple project with sensible defaults should be created.
Expand Down Expand Up @@ -221,12 +222,20 @@ getCabalVersion flags = do
cabVer <- return (flagToMaybe $ cabalVersion flags)
?>> maybePrompt flags (either (const defaultCabalVersion) id `fmap`
promptList "Please choose version of the Cabal specification to use"
[mkVersion [1,10], mkVersion [2,0], mkVersion [2,2], mkVersion [2,4]]
versionList
(Just defaultCabalVersion) displayCabalVersion False)
?>> return (Just defaultCabalVersion)

return $ flags { cabalVersion = maybeToFlag cabVer }

where
versionList = fmap mkVersion
[ [1,10]
, [2,0]
, [2,2]
, [2,4]
, [3,0]
]

-- | Get the package name: use the package directory (supplied, or the current
-- directory by default) as a guess. It looks at the SourcePackageDb to avoid
Expand Down
2 changes: 1 addition & 1 deletion cabal-install/changelog
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-*-change-log-*-

3.1.0.0 (current development version)
* TODO
* Add entry for cabal version 3.0 to `cabal init`

3.0.0.0 Mikhail Glushenkov <[email protected]> August 2019
* Parse comma-separated lists for extra-prog-path, extra-lib-dirs, extra-framework-dirs,
Expand Down