Skip to content

Commit 852dd5e

Browse files
authored
Merge of #11721
2 parents 9c13a3e + 579280a commit 852dd5e

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

cabal-install/src/Distribution/Client/Setup.hs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,12 +3020,12 @@ initCommand =
30203020
wrapText $
30213021
"Create a .cabal, CHANGELOG.md, minimal initial Haskell code and optionally a LICENSE file.\n"
30223022
++ "\n"
3023-
++ "Calling init with no arguments runs interactive mode, "
3023+
++ "Calling init with no arguments runs interactive mode by default, "
30243024
++ "which will try to guess as much as possible and prompt you for the rest.\n"
30253025
++ "Non-interactive mode can be invoked by the -n/--non-interactive flag, "
3026-
++ "which will let you specify the options via flags and will use the defaults for the rest.\n"
3027-
++ "It is also possible to call init with a single argument, which denotes the project's desired "
3028-
++ "root directory.\n"
3026+
++ "which will let you specify the options via flags and will either use the defaults for the rest, "
3027+
++ "or attempt to infer sensible defaults from your local development environment (e.g. $PATH).\n"
3028+
++ "For a basic simple project with minimal prompting and sensible defaults, issue the --simple flag.\n"
30293029
, commandNotes = Nothing
30303030
, commandUsage = \pname ->
30313031
"Usage: " ++ pname ++ " init [PROJECT ROOT] [FLAGS]\n"
@@ -3038,7 +3038,10 @@ initOptions _ =
30383038
[ option
30393039
['i']
30403040
["interactive"]
3041-
"interactive mode."
3041+
( "Interactive mode. Creates a prompt tree for project creation. \n"
3042+
++ "If -n/--non-interactive is issued, a simple project with inferred defaults \n"
3043+
++ "is created. If --simple is issued, then sensible defaults will be chosen as well."
3044+
)
30423045
IT.interactive
30433046
(\v flags -> flags{IT.interactive = v})
30443047
(boolOpt' (['i'], ["interactive"]) (['n'], ["non-interactive"]))

doc/buildinfo-fields-reference.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,4 +717,3 @@ type
717717
.. math::
718718
\left\{ \mathop{\mathord{``}\mathtt{exitcode\text{-}stdio\text{-}1\text{.}0}\mathord{"}}\mid\mathop{\mathord{``}\mathtt{detailed\text{-}0\text{.}9}\mathord{"}} \right\}
719719
720-

doc/cabal-commands.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,21 @@ Initialization and download
354354
cabal init
355355
^^^^^^^^^^
356356

357-
``cabal init [FLAGS]`` initialises a Cabal package, picking
358-
reasonable defaults. Run it in your project folder.
357+
``cabal init [FLAGS]`` initialises a Cabal package, by default prompting the user for inputs, or choosing
358+
sensible defaults to create a minimal project if specified. Run it in your project folder.
359359

360360
.. option:: -i, --interactive
361361

362-
Enable interactive mode.
362+
Enable interactive mode. This will prompt the user for inputs to help create the a minimal project.
363+
364+
.. option:: -n, --non-interactive
365+
366+
Enable non-interactive mode. This will attempt to infer project details from a user configuration
367+
or from basic environment variables, such as $PATH.
368+
369+
.. option:: --simple
370+
371+
Create a simple, minimal project of a user-defined project type with sensible defaults.
363372

364373
.. option:: -m, --minimal
365374

0 commit comments

Comments
 (0)