Copyright | Isaac Jones Simon Marlow 2003-2004 |
---|---|
License | BSD3 portions Copyright (c) 2007, Galois Inc. |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Simple file globbing.
Synopsis
- data GlobSyntaxError
- data GlobResult a
- matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [FilePath]
- runDirFileGlob :: Verbosity -> FilePath -> Glob -> IO [GlobResult FilePath]
- fileGlobMatches :: Glob -> FilePath -> Maybe (GlobResult FilePath)
- parseFileGlob :: Version -> FilePath -> Either GlobSyntaxError Glob
- explainGlobSyntaxError :: FilePath -> GlobSyntaxError -> String
- data Glob
Documentation
data GlobSyntaxError Source #
StarInDirectory | |
StarInFileName | |
StarInExtension | |
NoExtensionOnStar | |
EmptyGlob | |
LiteralFileNameGlobStar | |
VersionDoesNotSupportGlobStar | |
VersionDoesNotSupportGlob |
Instances
Eq GlobSyntaxError Source # | |
Defined in Distribution.Simple.Glob (==) :: GlobSyntaxError -> GlobSyntaxError -> Bool # (/=) :: GlobSyntaxError -> GlobSyntaxError -> Bool # | |
Show GlobSyntaxError Source # | |
Defined in Distribution.Simple.Glob |
data GlobResult a Source #
GlobMatch a | The glob matched the value supplied. |
GlobWarnMultiDot a | The glob did not match the value supplied because the cabal-version is too low and the extensions on the file did not precisely match the glob's extensions, but rather the glob was a proper suffix of the file's extensions; i.e., if not for the low cabal-version, it would have matched. |
GlobMissingDirectory FilePath | The glob couldn't match because the directory named doesn't
exist. The directory will be as it appears in the glob (i.e.,
relative to the directory passed to |
Instances
Functor GlobResult Source # | |
Defined in Distribution.Simple.Glob fmap :: (a -> b) -> GlobResult a -> GlobResult b Source # (<$) :: a -> GlobResult b -> GlobResult a Source # | |
Eq a => Eq (GlobResult a) Source # | |
Defined in Distribution.Simple.Glob (==) :: GlobResult a -> GlobResult a -> Bool # (/=) :: GlobResult a -> GlobResult a -> Bool # | |
Ord a => Ord (GlobResult a) Source # | |
Defined in Distribution.Simple.Glob compare :: GlobResult a -> GlobResult a -> Ordering # (<) :: GlobResult a -> GlobResult a -> Bool # (<=) :: GlobResult a -> GlobResult a -> Bool # (>) :: GlobResult a -> GlobResult a -> Bool # (>=) :: GlobResult a -> GlobResult a -> Bool # max :: GlobResult a -> GlobResult a -> GlobResult a # min :: GlobResult a -> GlobResult a -> GlobResult a # | |
Show a => Show (GlobResult a) Source # | |
Defined in Distribution.Simple.Glob |
matchDirFileGlob :: Verbosity -> Version -> FilePath -> FilePath -> IO [FilePath] Source #
This will die'
when the glob matches no files, or if the glob
refers to a missing directory, or if the glob fails to parse.
The Version
argument must be the spec version of the package
description being processed, as globs behave slightly differently
in different spec versions.
The first FilePath
argument is the directory that the glob is
relative to. It must be a valid directory (and hence it can't be
the empty string). The returned values will not include this
prefix.
The second FilePath
is the glob itself.
runDirFileGlob :: Verbosity -> FilePath -> Glob -> IO [GlobResult FilePath] Source #
Match files against a pre-parsed glob, starting in a directory.
The Version
argument must be the spec version of the package
description being processed, as globs behave slightly differently
in different spec versions.
The FilePath
argument is the directory that the glob is relative
to. It must be a valid directory (and hence it can't be the empty
string). The returned values will not include this prefix.
fileGlobMatches :: Glob -> FilePath -> Maybe (GlobResult FilePath) Source #
parseFileGlob :: Version -> FilePath -> Either GlobSyntaxError Glob Source #