From 1b8bb6331361f9fb133ae5514e4706d6397fb449 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Wed, 8 Apr 2026 21:11:18 -0600 Subject: [PATCH 1/5] init --- cabal-install/src/Distribution/Client/Setup.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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"])) From e8e4c8066a64d30d6a04980a71a4e89a39f93cd5 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Thu, 9 Apr 2026 14:08:22 -0600 Subject: [PATCH 2/5] update rtd init spec --- doc/cabal-commands.rst | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 06a1e082373..9febfff00c3 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, prompting the user for inputs or choosing + sensible defaults to create a minimal project. 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 From 6c4a7ab112e02c6d59863f4d15baaa06b1d6c718 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Thu, 9 Apr 2026 14:09:55 -0600 Subject: [PATCH 3/5] note defaults --- doc/cabal-commands.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index 9febfff00c3..fd3b44a3ba2 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -354,8 +354,8 @@ Initialization and download cabal init ^^^^^^^^^^ -``cabal init [FLAGS]`` initialises a Cabal package, prompting the user for inputs or choosing - sensible defaults to create a minimal project. 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 From 51e8d30b73400a85a4fe49f2e7a13c479879c781 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Fri, 24 Apr 2026 21:25:48 +0200 Subject: [PATCH 4/5] fix whitespace --- doc/buildinfo-fields-reference.rst | 1 - doc/cabal-commands.rst | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/buildinfo-fields-reference.rst b/doc/buildinfo-fields-reference.rst index 21ad93188fc..61b5c0aae1d 100644 --- a/doc/buildinfo-fields-reference.rst +++ b/doc/buildinfo-fields-reference.rst @@ -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\} - diff --git a/doc/cabal-commands.rst b/doc/cabal-commands.rst index fd3b44a3ba2..7b3da97527d 100644 --- a/doc/cabal-commands.rst +++ b/doc/cabal-commands.rst @@ -354,21 +354,21 @@ Initialization and download cabal init ^^^^^^^^^^ -``cabal init [FLAGS]`` initialises a Cabal package, by default prompting the user for inputs, or choosing +``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. This will prompt the user for inputs to help create the a minimal project. + Enable interactive mode. This will prompt the user for inputs to help create the a minimal project. -.. option:: -n, --non-interactive +.. option:: -n, --non-interactive - Enable non-interactive mode. This will attempt to infer project details from a user configuration + 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 +.. option:: --simple - Create a simple, minimal project of a user-defined project type with sensible defaults. + Create a simple, minimal project of a user-defined project type with sensible defaults. .. option:: -m, --minimal From 490d244af44eb52638a364a23097d69b9cfd3da2 Mon Sep 17 00:00:00 2001 From: Emily Pillmore Date: Fri, 24 Apr 2026 22:12:50 +0200 Subject: [PATCH 5/5] run fourmolu --- cabal-install/src/Distribution/Client/Setup.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cabal-install/src/Distribution/Client/Setup.hs b/cabal-install/src/Distribution/Client/Setup.hs index 611bc3c1a69..c2732990b7d 100644 --- a/cabal-install/src/Distribution/Client/Setup.hs +++ b/cabal-install/src/Distribution/Client/Setup.hs @@ -3038,9 +3038,10 @@ initOptions _ = [ option ['i'] ["interactive"] - ("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.") + ( "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"]))