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

Default to non-interactive init. #5902

Merged
merged 4 commits into from
Aug 27, 2019
Merged
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
2 changes: 1 addition & 1 deletion cabal-install/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ commentSavedConfig = do
globalRemoteRepos = toNubList [defaultRemoteRepo]
},
savedInitFlags = mempty {
IT.interactive = toFlag True,
IT.interactive = toFlag False,
IT.cabalVersion = toFlag (mkVersion [1,10]),
IT.language = toFlag Haskell2010,
IT.license = toFlag BSD3,
Expand Down
4 changes: 2 additions & 2 deletions cabal-install/Distribution/Client/Init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,8 @@ eligibleForTestSuite flags =
maybePrompt :: InitFlags -> IO t -> IO (Maybe t)
maybePrompt flags p =
case interactive flags of
Flag False -> return Nothing
_ -> Just `fmap` p
Flag True -> Just `fmap` p
_ -> return Nothing

-- | Create a prompt with optional default value that returns a
-- String.
Expand Down
18 changes: 9 additions & 9 deletions cabal-install/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2230,17 +2230,17 @@ defaultInitFlags = emptyInitFlags { IT.initVerbosity = toFlag normal }
initCommand :: CommandUI IT.InitFlags
initCommand = CommandUI {
commandName = "init",
commandSynopsis = "Create a new .cabal package file (interactively).",
commandSynopsis = "Create a new .cabal package file.",
commandDescription = Just $ \_ -> wrapText $
"Cabalise a project by creating a .cabal, Setup.hs, and "
++ "optionally a LICENSE file.\n"
"Create a .cabal, Setup.hs, and optionally a LICENSE file.\n"
++ "\n"
++ "Calling init with no arguments (recommended) uses an "
++ "interactive mode, which will try to guess as much as "
++ "possible and prompt you for the rest. Command-line "
++ "arguments are provided for scripting purposes. "
++ "If you don't want interactive mode, be sure to pass "
++ "the -n flag.\n",
++ "Calling init with no arguments creates an executable, "
++ "guessing as many options as possible. The interactive "
++ "mode can be invoked by the -i/--interactive flag, which "
++ "will try to guess as much as possible and prompt you for "
++ "the rest. You can change init to always be interactive by "
++ "setting the interactive flag in your configuration file. "
++ "Command-line arguments are provided for scripting purposes.\n",
commandNotes = Nothing,
commandUsage = \pname ->
"Usage: " ++ pname ++ " init [FLAGS]\n",
Expand Down
1 change: 1 addition & 0 deletions cabal-install/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
that make it possible to copy the executable instead of symlinking it
* --symlink-bindir no longer controls the symlinking directory of
v2-install (installdir controls both symlinking and copying now)
* Default to non-interactive init.
* Add --test-wrapper that allows a prebuild script to set the test environment.
* Add filterTestFlags: filter test-wrapper for Cabal < 3.0.0.
* Cabal now only builds the minimum of a package for `v2-install` (#5754, #6091)
Expand Down