diff --git a/cabal-install/src/Distribution/Client/Setup.hs b/cabal-install/src/Distribution/Client/Setup.hs index c2651a33331..611bc3c1a69 100644 --- a/cabal-install/src/Distribution/Client/Setup.hs +++ b/cabal-install/src/Distribution/Client/Setup.hs @@ -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" @@ -3038,7 +3038,9 @@ 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"])) diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 06a1e082373..fd3b44a3ba2 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -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