makedo-0.1: Helper for writing redo scripts in Haskell

Makedo.Target

Contents

Synopsis

your main function

redoMain :: [Target] -> IO ()Source

Your main function should probably just invoke this and do nothing else

listing :: [Target] -> ExactTargetSource

Special target that prints out the targets you can run Note that makedo automatically includes this

creating targets

data Target Source

A makedo script is basically just a list of Target

If a target matches the input file name, its action is run

Constructors

Target 

Fields

match :: FilePath -> Bool
 
description :: (String, String)

(name, blurb) for human consumption only

action :: RedoArgs -> IO ()
 

Instances

data RedoArgs Source

Constructors

RedoArgs 

Fields

rwrite :: FilePath

temporary file managed by redo; write your output here or to stdout; it will be renamed to rname if the rule is successful

rname :: FilePath

desired filename

rext :: String
 

data ExactTarget Source

Targets that use an exact filename match

Constructors

ExactTarget 

data WildcardTarget Source

Constructors

WildcardTarget 

Fields

wPrefix :: FilePath
 
wExtension :: String

as recognised by System.FilePath

wBlurb :: String
 
wAction :: RedoArgs -> IO ()
 

class ShowPC a whereSource

Useful for targets that take parameters which you want to convert into path components

Methods

showPC :: a -> StringSource

within target actions