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

Safe Haskell | None
Language | Haskell2010

Distribution.Client.CmdListBin

Contents

- Internals exposed for testing

Synopsis

- listbinCommand :: CommandUI (NixStyleFlags ())
- listbinAction :: NixStyleFlags () -> [String] -> GlobalFlags -> IO ()
- selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either ListBinTargetProblem [k]
- selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either ListBinTargetProblem k
- noComponentsProblem :: TargetSelector -> ListBinTargetProblem
- matchesMultipleProblem :: TargetSelector -> [AvailableTarget ()] -> ListBinTargetProblem
- multipleTargetsProblem :: TargetsMap -> TargetProblem ListBinProblem
- componentNotRightKindProblem :: PackageId -> ComponentName -> TargetProblem ListBinProblem

# Documentation

listbinCommand :: CommandUI (NixStyleFlags ()) #

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

# Internals exposed for testing

selectPackageTargets :: TargetSelector -> [AvailableTarget k] -> Either ListBinTargetProblem [k] #

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

For the `list-bin` command we select the exe or flib if there is only one and it's buildable. Fail if there are no or multiple buildable exe components.

selectComponentTarget :: SubComponentTarget -> AvailableTarget k -> Either ListBinTargetProblem k #

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

For the `run` command we just need to check it is a executable-like (an executable, a test, or a benchmark), in addition to the basic checks on being buildable etc.

noComponentsProblem :: TargetSelector -> ListBinTargetProblem #

matchesMultipleProblem :: TargetSelector -> [AvailableTarget ()] -> ListBinTargetProblem #

multipleTargetsProblem :: TargetsMap -> TargetProblem ListBinProblem #

componentNotRightKindProblem :: PackageId -> ComponentName -> TargetProblem ListBinProblem #