cabal-install-3.8.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellNone
LanguageHaskell2010

Distribution.Client.Init.FlagExtractors

Synopsis

Flag extractors

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

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

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

Extract minimal cabal file flag (implies nocomments)

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

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).

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

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 Source #

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 Source #

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 Source #

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

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

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

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

Prompt for a homepage URL for the package.

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

Prompt for a project synopsis.

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

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) Source #

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

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

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

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

Ask whether the project builds a library or executable.

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

Ask for the Haskell base language of the package.

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

Ask whether to generate explanatory comments.

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

Ask for the application root directory.

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

Ask for the source (library) root directory.

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

Retrieve the list of exposed modules

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

Retrieve the list of build tools

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

Retrieve the list of dependencies

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

Retrieve the list of extensions

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

Tell whether to overwrite files on write

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

Retrieve the list of other modules

Shared prompts