cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.CmdListBin

Synopsis

Documentation

Internals exposed for testing

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

This defines what a TargetSelector means for the list-bin command. It selects the AvailableTargets 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 Source #

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

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