The hgrev package

[maintain]
Warnings:

[Overview]

`hgrev` provides two modules: - `Development.HgRev` - <https://mercurial.selenic.com Mercurial (hg)> Haskell API - `Development.HgRev.TH` - Template Haskell splice to compile version info into Haskell code

Use @$(hgRevStateTH defFormat)@ with Template Haskell enabled to insert the formatted version string.

[Requirements]

`hgrev` requires the `hg` binary is installed and available on the system. `Development.HgRev.HgRev` and `Development.HgRev.HgState` are obtained via two separate calls to `hg` because working directory state isn't available programmatically.

[Usage Example]

> -# LANGUAGE OverloadedStrings #- > -# LANGUAGE TemplateHaskell #- > > module Example where > > import Data.Monoid ((<>)) > import Data.Text (Text, pack) > import Development.HgRev.TH (defFormat, hgRevStateTH, jsonFormat) > import Options.Applicative (Parser, ParserInfo, execParser, fullDesc, > help, helper, info, infoOption, long, > progDesc, short) > > main :: IO () > main = execParser parserInfo >> return () > > verSwitch :: Parser (a -> a) > verSwitch = > infoOption ("HG rev: " <> $(hgRevStateTH defFormat)) > $ long "version" > <> short 'v' > <> help "Display version information" > > jsonSwitch :: Parser (a -> a) > jsonSwitch = > infoOption $(hgRevStateTH jsonFormat) > $ long "json" > <> short 'J' > <> help "Display JSON version information" > > parserInfo :: ParserInfo (a -> a) > parserInfo = info (helper <*> verSwitch <* jsonSwitch) fullDesc >

Check out the <https://hackage.haskell.org/package/gitrev gitrev> package for similar git functionality.

Properties

Versions0.1.0.0, 0.1.1, 0.1.2, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.2.0, 0.2.1
Dependenciesaeson (>=0.8 && <0.10), base (>=4.7 && <4.9), bytestring (==0.10.*), directory (==1.2.*), filepath (==1.4.*), process (>=1.2 && <1.4), template-haskell (==2.10.*) [details]
LicenseMIT
AuthorLuke Hoersten
Maintainerluke@hoersten.org
CategoryDevelopment
Home pagehttps://github.com/LukeHoersten/hgrev
Bug trackerhttps://github.com/LukeHoersten/hgrev/issues
Source repositoryhead: git clone git://github.com/LukeHoersten/hgrev.git
UploadedSat Sep 26 18:13:27 UTC 2015 by LukeHoersten

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees