Modulecabal-install-3.12.1.0Haskell2010
Distribution.Client.CmdRun
cabal-install CLI command: run
- 8 values
- Packagecabal-install-3.12.1.0
- Exports8
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceCmdRun.hs
The run CLI and action
4 declarationsThe run command runs a specified executable-like component, building it
first if necessary. The component can be either an executable, a test,
or a benchmark. This is particularly useful for passing arguments to
exestestsbenchs by simply appending them after a --.
For more details on how this works, see the module Distribution.Client.ProjectOrchestration
Handle cabal invoked as script interpreter, see also validScript
First argument is the FilePath to the script to be executed; second argument is a list of arguments to be passed to the script.
Used by the main CLI parser as heuristic to decide whether cabal was
invoked as a script interpreter, i.e. via
#! /usr/bin/env cabalor
#! /usr/bin/cabalAs the first argument passed to cabal will be a filepath to the
script to be interpreted.
See also handleShebang
Internals exposed for testing
4 declarationsThis defines what a TargetSelector means for the run command.
It selects the AvailableTargets that the TargetSelector refers to,
or otherwise classifies the problem.
For the run command we select the exe if there is only one and it's
buildable. Fail if there are no or multiple buildable exe components.
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.