Distribution.Client.Init.FlagExtractors

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

Safe Haskell | None
Language | Haskell2010

Distribution.Client.Init.FlagExtractors

Contents

- Flag extractors
- Shared prompts

Synopsis

- getPackageDir :: Interactive m => InitFlags -> m FilePath
- getSimpleProject :: Interactive m => InitFlags -> m Bool -> m Bool
- getMinimal :: Interactive m => InitFlags -> m Bool
- getCabalVersion :: Interactive m => InitFlags -> m CabalSpecVersion -> m CabalSpecVersion
- getCabalVersionNoPrompt :: InitFlags -> CabalSpecVersion
- getPackageName :: Interactive m => InitFlags -> m PackageName -> m PackageName
- getVersion :: Interactive m => InitFlags -> m Version -> m Version
- getLicense :: Interactive m => InitFlags -> m SpecLicense -> m SpecLicense
- getAuthor :: Interactive m => InitFlags -> m String -> m String
- getEmail :: Interactive m => InitFlags -> m String -> m String
- getHomepage :: Interactive m => InitFlags -> m String -> m String
- getSynopsis :: Interactive m => InitFlags -> m String -> m String
- getCategory :: Interactive m => InitFlags -> m String -> m String
- getExtraSrcFiles :: Interactive m => InitFlags -> m (Set String)
- getExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set String))
- getPackageType :: Interactive m => InitFlags -> m PackageType -> m PackageType
- getMainFile :: Interactive m => InitFlags -> m HsFilePath -> m HsFilePath
- getInitializeTestSuite :: Interactive m => InitFlags -> m Bool -> m Bool
- getTestDirs :: Interactive m => InitFlags -> m [String] -> m [String]
- getLanguage :: Interactive m => InitFlags -> m Language -> m Language
- getNoComments :: Interactive m => InitFlags -> m Bool -> m Bool
- getAppDirs :: Interactive m => InitFlags -> m [String] -> m [String]
- getSrcDirs :: Interactive m => InitFlags -> m [String] -> m [String]
- getExposedModules :: Interactive m => InitFlags -> m (NonEmpty ModuleName)
- getBuildTools :: Interactive m => InitFlags -> m [Dependency]
- getDependencies :: Interactive m => InitFlags -> m [Dependency] -> m [Dependency]
- getOtherExts :: Interactive m => InitFlags -> m [Extension]
- getOverwrite :: Interactive m => InitFlags -> m Bool
- getOtherModules :: Interactive m => InitFlags -> m [ModuleName]
- simpleProjectPrompt :: Interactive m => InitFlags -> m Bool
- initializeTestSuitePrompt :: Interactive m => InitFlags -> m Bool
- packageTypePrompt :: Interactive m => InitFlags -> m PackageType
- testMainPrompt :: Interactive m => m HsFilePath
- dependenciesPrompt :: Interactive m => InstalledPackageIndex -> InitFlags -> m [Dependency]

# Flag extractors

getPackageDir :: Interactive m => InitFlags -> m FilePath #

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

Ask if a simple project with sensible defaults should be created.

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

Extract minimal cabal file flag (implies nocomments)

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

Get the version of the cabal spec to use.

The spec version can be specified by the InitFlags cabalVersion field. If none is specified then the user is prompted to pick from a list of supported versions (see code below).

getCabalVersionNoPrompt :: InitFlags -> CabalSpecVersion #

getPackageName :: Interactive m => InitFlags -> m PackageName -> m PackageName #

Get the package name: use the package directory (supplied, or the current directory by default) as a guess. It looks at the SourcePackageDb to avoid using an existing package name.

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

Package version: use 0.1.0.0 as a last resort, but try prompting the user if possible.

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

Choose a license for the package. The license can come from Initflags (license field), if it is not present then prompt the user from a predefined list of licenses.

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

The author's name. Prompt, or try to guess from an existing darcs repo.

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

The author's email. Prompt, or try to guess from an existing darcs repo.

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

Prompt for a homepage URL for the package.

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

Prompt for a project synopsis.

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

Prompt for a package category. Note that it should be possible to do some smarter guessing here too, i.e. look at the name of the top level source directory.

getExtraSrcFiles :: Interactive m => InitFlags -> m (Set String) #

Try to guess extra source files (don't prompt the user).

getExtraDocFiles :: Interactive m => InitFlags -> m (Maybe (Set String)) #

Try to guess extra source files (don't prompt the user).

getPackageType :: Interactive m => InitFlags -> m PackageType -> m PackageType #

Ask whether the project builds a library or executable.

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

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

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

getLanguage :: Interactive m => InitFlags -> m Language -> m Language #

Ask for the Haskell base language of the package.

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

Ask whether to generate explanatory comments.

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

Ask for the application root directory.

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

Ask for the source (library) root directory.

getExposedModules :: Interactive m => InitFlags -> m (NonEmpty ModuleName) #

Retrieve the list of exposed modules

getBuildTools :: Interactive m => InitFlags -> m [Dependency] #

Retrieve the list of build tools

getDependencies :: Interactive m => InitFlags -> m [Dependency] -> m [Dependency] #

Retrieve the list of dependencies

getOtherExts :: Interactive m => InitFlags -> m [Extension] #

Retrieve the list of extensions

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

Tell whether to overwrite files on write

getOtherModules :: Interactive m => InitFlags -> m [ModuleName] #

Retrieve the list of other modules

# Shared prompts

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

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

packageTypePrompt :: Interactive m => InitFlags -> m PackageType #

testMainPrompt :: Interactive m => m HsFilePath #

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