-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A command line program for extracting compiler arguments from a cabal file.
--
-- For further details please consult the README.
@package cabal-cargs
@version 0.7.2
module CabalCargs.Formatting
-- | How the fields from the cabal file should be printed out.
data Formatting
-- | as ghc compatible arguments
Ghc :: Formatting
-- | as hdevtools compatible arguments
Hdevtools :: Formatting
-- | the field values are printed as present in the cabal file
Pure :: Formatting
instance Typeable Formatting
instance Data Formatting
instance Show Formatting
instance Eq Formatting
instance Default Formatting
module CabalCargs.Fields
-- | A compiler relevant field. Till Package_Db all fields are from
-- the cabal file with the same name, just with lower case letters and
-- the _ replaced by a -.
data Field
Hs_Source_Dirs :: Field
Ghc_Options :: Field
Default_Extensions :: Field
Default_Language :: Field
Cpp_Options :: Field
C_Sources :: Field
Cc_Options :: Field
Extra_Lib_Dirs :: Field
Extra_Libraries :: Field
Ld_Options :: Field
Include_Dirs :: Field
Includes :: Field
Build_Depends :: Field
-- | the package database of a cabal sandbox
Package_Db :: Field
-- | dirs of automatically generated haskell source files by cabal (e.g.
-- Paths_*)
Autogen_Hs_Source_Dirs :: Field
-- | dirs of automatically generated include files by cabal
Autogen_Include_Dirs :: Field
-- | automatically generated include files by cabal (e.g. cabal_macros.h)
Autogen_Includes :: Field
-- | the socket file for hdevtools
Hdevtools_Socket :: Field
-- | Get all known fields.
allFields :: [Field]
-- | Which fields should be collected
type Fields = [Field]
instance Typeable Field
instance Data Field
instance Show Field
instance Eq Field
instance Enum Field
instance Bounded Field
module CabalCargs.Args
-- | The command line arguments of the cabal-cargs command.
data Args
Args :: Bool -> [String] -> [String] -> [String] -> Bool -> [Field] -> [Field] -> Formatting -> Maybe FilePath -> Maybe FilePath -> [String] -> [String] -> Maybe String -> Maybe String -> Bool -> Args
library :: Args -> Bool
executable :: Args -> [String]
testSuite :: Args -> [String]
benchmark :: Args -> [String]
allSections :: Args -> Bool
only :: Args -> [Field]
ignore :: Args -> [Field]
format :: Args -> Formatting
sourceFile :: Args -> Maybe FilePath
cabalFile :: Args -> Maybe FilePath
enable :: Args -> [String]
disable :: Args -> [String]
os :: Args -> Maybe String
arch :: Args -> Maybe String
relative :: Args -> Bool
get :: IO Args
instance Typeable Args
instance Data Args
instance Show Args
instance Eq Args
module CabalCargs.Spec
-- | Specifies which compiler args from which sections should be collected.
data Spec
Spec :: [Section] -> Fields -> CondVars -> GenericPackageDescription -> FilePath -> Maybe FilePath -> Maybe FilePath -> Bool -> Spec
-- | the sections used for collecting the compiler args
sections :: Spec -> [Section]
-- | for these fields compiler args are collected
fields :: Spec -> Fields
-- | used for the evaluation of the conditional fields in the cabal file
condVars :: Spec -> CondVars
-- | the package description of the read in cabal file
pkgDescrp :: Spec -> GenericPackageDescription
-- | the cabal file read from
cabalFile :: Spec -> FilePath
-- | the dist directory of the cabal build, a relative path to the
-- directory of the cabal file
distDir :: Spec -> Maybe FilePath
-- | the directory of package database of the cabal sandbox, a relative
-- path to the directory of the cabal file
packageDB :: Spec -> Maybe FilePath
-- | if all returned paths are relative to the directory of the cabal file,
-- otherwise all paths are absolute
relativePaths :: Spec -> Bool
-- | Create a Spec by the command line arguments given to
-- 'cabal-cargs'.
--
-- Depending on the command line arguments fromCmdArgs might
-- behave like fromCabalFile, if only a cabal file was given, like
-- fromSourceFile, if only a source file was given or like a mix
-- of both, if a cabal file and a source file have been given.
fromCmdArgs :: Args -> IO (Either Error Spec)
module CabalCargs.CompilerArgs
-- | The collected compiler args from the cabal file. Till the field
-- packageDB all fields represent the equaliy named fields
-- (- replaced by CamelCase) from the cabal file.
data CompilerArgs
CompilerArgs :: [FilePath] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [String] -> [String] -> [FilePath] -> [String] -> [String] -> Maybe FilePath -> [FilePath] -> [FilePath] -> [String] -> Maybe FilePath -> CompilerArgs
hsSourceDirs :: CompilerArgs -> [FilePath]
ghcOptions :: CompilerArgs -> [String]
defaultExtensions :: CompilerArgs -> [String]
defaultLanguage :: CompilerArgs -> [String]
cppOptions :: CompilerArgs -> [String]
cSources :: CompilerArgs -> [FilePath]
ccOptions :: CompilerArgs -> [String]
extraLibDirs :: CompilerArgs -> [FilePath]
extraLibraries :: CompilerArgs -> [String]
ldOptions :: CompilerArgs -> [String]
includeDirs :: CompilerArgs -> [FilePath]
includes :: CompilerArgs -> [String]
buildDepends :: CompilerArgs -> [String]
-- | the path to the package database of the cabal sandbox
packageDB :: CompilerArgs -> Maybe FilePath
-- | dirs of automatically generated haskell source files by cabal (e.g.
-- Paths_*)
autogenHsSourceDirs :: CompilerArgs -> [FilePath]
-- | dirs of automatically generated include files by cabal
autogenIncludeDirs :: CompilerArgs -> [FilePath]
-- | automatically generated include files by cabal (e.g. cabal_macros.h)
autogenIncludes :: CompilerArgs -> [String]
-- | the path to the hdevtools socket file
hdevtoolsSocket :: CompilerArgs -> Maybe FilePath
-- | Create a CompilerArgs by the command line arguments given to
-- 'cabal-cargs'.
fromCmdArgs :: Args -> IO (Either Error CompilerArgs)
-- | Create a CompilerArgs and collect the compiler args specified
-- by Spec.
fromSpec :: Spec -> CompilerArgs
instance Show CompilerArgs
instance Eq CompilerArgs
module CabalCargs.Format
format :: Formatting -> CompilerArgs -> [String]