Skip to content
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
13 changes: 8 additions & 5 deletions cabal-install/src/Distribution/Client/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3020,12 +3020,12 @@ initCommand =
wrapText $
"Create a .cabal, CHANGELOG.md, minimal initial Haskell code and optionally a LICENSE file.\n"
++ "\n"
++ "Calling init with no arguments runs interactive mode, "
++ "Calling init with no arguments runs interactive mode by default, "
++ "which will try to guess as much as possible and prompt you for the rest.\n"
++ "Non-interactive mode can be invoked by the -n/--non-interactive flag, "
++ "which will let you specify the options via flags and will use the defaults for the rest.\n"
++ "It is also possible to call init with a single argument, which denotes the project's desired "
++ "root directory.\n"
++ "which will let you specify the options via flags and will either use the defaults for the rest, "
++ "or attempt to infer sensible defaults from your local development environment (e.g. $PATH).\n"
++ "For a basic simple project with minimal prompting and sensible defaults, issue the --simple flag.\n"
, commandNotes = Nothing
, commandUsage = \pname ->
"Usage: " ++ pname ++ " init [PROJECT ROOT] [FLAGS]\n"
Expand All @@ -3038,7 +3038,10 @@ initOptions _ =
[ option
['i']
["interactive"]
"interactive mode."
( "Interactive mode. Creates a prompt tree for project creation. \n"
++ "If -n/--non-interactive is issued, a simple project with inferred defaults \n"
++ "is created. If --simple is issued, then sensible defaults will be chosen as well."
)
IT.interactive
(\v flags -> flags{IT.interactive = v})
(boolOpt' (['i'], ["interactive"]) (['n'], ["non-interactive"]))
Expand Down
1 change: 0 additions & 1 deletion doc/buildinfo-fields-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -717,4 +717,3 @@ type
.. math::
\left\{ \mathop{\mathord{``}\mathtt{exitcode\text{-}stdio\text{-}1\text{.}0}\mathord{"}}\mid\mathop{\mathord{``}\mathtt{detailed\text{-}0\text{.}9}\mathord{"}} \right\}


15 changes: 12 additions & 3 deletions doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,21 @@ Initialization and download
cabal init
^^^^^^^^^^

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

.. option:: -i, --interactive

Enable interactive mode.
Enable interactive mode. This will prompt the user for inputs to help create the a minimal project.

.. option:: -n, --non-interactive

Enable non-interactive mode. This will attempt to infer project details from a user configuration
or from basic environment variables, such as $PATH.

.. option:: --simple

Create a simple, minimal project of a user-defined project type with sensible defaults.

.. option:: -m, --minimal

Expand Down
Loading