cabal-install-3.10.2.1: The command-line interface for Cabal and Hackage.

Copyright | (c) Brent Yorgey 2009
License | BSD-like
Maintainer | cabal-devel@haskell.org
Stability | provisional
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Client.Init.Interactive.Command

Contents

- Commands
  - Target generation
  - Prompts

Description

Implementation of the 'cabal init' command, which creates an initial .cabal file for a project.

Synopsis

- createProject :: Interactive m => Verbosity -> InstalledPackageIndex -> SourcePackageDb -> InitFlags -> m ProjectSettings
- genPkgDescription :: Interactive m => InitFlags -> SourcePackageDb -> m PkgDescription
- genLibTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m LibTarget
- genExeTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m ExeTarget
- genTestTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m (Maybe TestTarget)
- cabalVersionPrompt :: Interactive m => InitFlags -> m CabalSpecVersion
- packageNamePrompt :: Interactive m => SourcePackageDb -> InitFlags -> m PackageName
- versionPrompt :: Interactive m => InitFlags -> m Version
- licensePrompt :: Interactive m => InitFlags -> m SpecLicense
- authorPrompt :: Interactive m => InitFlags -> m String
- emailPrompt :: Interactive m => InitFlags -> m String
- homepagePrompt :: Interactive m => InitFlags -> m String
- synopsisPrompt :: Interactive m => InitFlags -> m String
- categoryPrompt :: Interactive m => InitFlags -> m String
- mainFilePrompt :: Interactive m => InitFlags -> m HsFilePath
- testDirsPrompt :: Interactive m => InitFlags -> m [String]
- languagePrompt :: Interactive m => InitFlags -> String -> m Language
- noCommentsPrompt :: Interactive m => InitFlags -> m Bool
- appDirsPrompt :: Interactive m => InitFlags -> m [String]
- dependenciesPrompt :: Interactive m => InstalledPackageIndex -> InitFlags -> m [Dependency]
- srcDirsPrompt :: Interactive m => InitFlags -> m [String]

# Commands

createProject :: Interactive m => Verbosity -> InstalledPackageIndex -> SourcePackageDb -> InitFlags -> m ProjectSettings #

Main driver for interactive prompt code.

## Target generation

genPkgDescription :: Interactive m => InitFlags -> SourcePackageDb -> m PkgDescription #

Extract flags relevant to a package description and interactively generate a `PkgDescription` object for creation. If the user specifies the generation of a simple package, then a simple target with defaults is generated.

genLibTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m LibTarget #

Extract flags relevant to a library target and interactively generate a `LibTarget` object for creation. If the user specifies the generation of a simple package, then a simple target with defaults is generated.

genExeTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m ExeTarget #

Extract flags relevant to a executable target and interactively generate a `ExeTarget` object for creation. If the user specifies the generation of a simple package, then a simple target with defaults is generated.

genTestTarget :: Interactive m => InitFlags -> InstalledPackageIndex -> m (Maybe TestTarget) #

Extract flags relevant to a test target and interactively generate a `TestTarget` object for creation. If the user specifies the generation of a simple package, then a simple target with defaults is generated.

Note: this workflow is only enabled if the user answers affirmatively when prompted, or if the user passes in the flag to enable test suites at command line.

## Prompts

cabalVersionPrompt :: Interactive m => InitFlags -> m CabalSpecVersion #

packageNamePrompt :: Interactive m => SourcePackageDb -> InitFlags -> m PackageName #

versionPrompt :: Interactive m => InitFlags -> m Version #

licensePrompt :: Interactive m => InitFlags -> m SpecLicense #

authorPrompt :: Interactive m => InitFlags -> m String #

emailPrompt :: Interactive m => InitFlags -> m String #

homepagePrompt :: Interactive m => InitFlags -> m String #

synopsisPrompt :: Interactive m => InitFlags -> m String #

categoryPrompt :: Interactive m => InitFlags -> m String #

mainFilePrompt :: Interactive m => InitFlags -> m HsFilePath #

testDirsPrompt :: Interactive m => InitFlags -> m [String] #

languagePrompt :: Interactive m => InitFlags -> String -> m Language #

noCommentsPrompt :: Interactive m => InitFlags -> m Bool #

appDirsPrompt :: Interactive m => InitFlags -> m [String] #

Ask for the application root directory.

dependenciesPrompt :: Interactive m => InstalledPackageIndex -> InitFlags -> m [Dependency] #

srcDirsPrompt :: Interactive m => InitFlags -> m [String] #

Ask for the source (library) root directory.