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

Safe Haskell | None
Language | Haskell2010

Distribution.Client.CmdHaddock

Contents

- The `haddock` CLI and action
- Internals exposed for testing

Description

cabal-install CLI command: haddock

Synopsis

- haddockCommand :: CommandUI (NixStyleFlags ClientHaddockFlags)
- haddockAction :: NixStyleFlags ClientHaddockFlags -> [String] -> GlobalFlags -> IO ()
- newtype ClientHaddockFlags = ClientHaddockFlags {
  - openInBrowser :: Flag Bool
  }
- selectPackageTargets :: HaddockFlags -> TargetSelector -> [AvailableTarget k] -> Either TargetProblem' [k]
- selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either TargetProblem' k

# The `haddock` CLI and action

haddockCommand :: CommandUI (NixStyleFlags ClientHaddockFlags) #

haddockAction :: NixStyleFlags ClientHaddockFlags -> [String] -> GlobalFlags -> IO () #

The `haddock` command is TODO.

For more details on how this works, see the module Distribution.Client.ProjectOrchestration

newtype ClientHaddockFlags #

Constructors

ClientHaddockFlags |

Fields

- openInBrowser :: Flag Bool

# Internals exposed for testing

selectPackageTargets :: HaddockFlags -> TargetSelector -> [AvailableTarget k] -> Either TargetProblem' [k] #

This defines what a `TargetSelector` means for the `haddock` command. It selects the `AvailableTarget`s that the `TargetSelector` refers to, or otherwise classifies the problem.

For the `haddock` command we select all buildable libraries. Additionally, depending on the `--executables` flag we also select all the buildable exes. We do similarly for test-suites, benchmarks and foreign libs.

selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either TargetProblem' k #

For a `TargetComponent` `TargetSelector`, check if the component can be selected.

For the `haddock` command we just need the basic checks on being buildable etc.