twitch 0.1.3.0 → 0.1.4.0
raw patch · 3 files changed
+39/−12 lines, 3 files
Files
- src/Twitch.hs +5/−1
- src/Twitch/Main.hs +32/−8
- twitch.cabal +2/−3
src/Twitch.hs view
@@ -74,9 +74,13 @@ , addModify , name -- * Advanced Main+ , DebounceType (..)+ , LoggerType (..) , Options (..) , defaultMainWithOptions -- * Running as a library+ , Issue (..)+ , InternalRule , Config (..) , run , runWithConfig@@ -84,7 +88,7 @@ , DepM ) where import Twitch.Internal -import Twitch.InternalRule (Config (..))+import Twitch.InternalRule (Config (..), Issue (..), InternalRule) import Twitch.Main import Twitch.Run import Twitch.Rule (Rule, RuleAction, Name, PatternText)
src/Twitch/Main.hs view
@@ -23,7 +23,6 @@ -- parse the command line -- - concatMapM f = fmap concat . mapM f data LoggerType @@ -44,19 +43,41 @@ data Options = Options { log :: LoggerType+ -- ^ The logger type. + -- This cooresponds to the --log or -l argument. The valid options+ -- are "LogToStdout", "LogToFile", and "NoLogger"+ -- If "LogToFile" a file can provide with the 'logFile' field. , logFile :: Maybe FilePath- -- ^ A logger for the issues + -- ^ The file to log to+ -- This is only used if the 'log' field is set to "LogToFile".+ -- This cooresponds to the --log-file or -f argument , dirsToWatch :: [FilePath]- -- ^ The directories to watch+ -- ^ The directories to watch. + -- This cooresponds to the --directories and -d argument , recurseThroughDirectories :: Bool+ -- ^ If true, main will recurse throug all subdirectories of the 'dirsToWatch' + -- field. Otherwise the 'dirsToWatch' will be used literally.+ -- By default this is empty and the currentDirectory is used. , debounce :: DebounceType+ -- ^ This corresponds to the debounce type used in the fsnotify library+ -- The argument for default main is --debounce or -b .+ -- Valid options are "DebounceDefault", "Debounce", "NoDebounce"+ -- If "Debounce" is used then a debounce amount must be specified with the + -- 'debounceAmount' , debounceAmount :: Double- -- ^ Debounce configuration+ -- ^ The amount to debounce. This is only meaningful when 'debounce' is set+ -- to 'Debounce'. + -- It cooresponds to the --debounce-amount or -a argument , pollInterval :: Int- -- ^ poll interval+ -- ^ poll interval if polling is used.+ -- This cooresponds to the --poll-interval or -i argument , usePolling :: Bool- -- ^ config for the file watch+ -- ^ If true polling is used instead of events.+ -- This cooresponds to the --poll or -p argument , currentDir :: Maybe FilePath+ -- ^ The current directory to append to the glob patterns. If Nothing then+ -- the value is whatever is returned by 'getCurrentDirectory'+ -- This cooresponds to the --current-dir or -c arguments } data DebounceType @@ -185,12 +206,15 @@ -- | Simplest way to create a file watcher app. Set your main equal to defaultMain -- and you are good to go. See the module documentation for examples. -- +-- The command line is parsed to make 'Options' value. For more information on+-- the arguments that can be passed see the doc for 'Options' and the run the +-- executable made with defaultMain with the --help argument. defaultMain :: Dep -> IO () defaultMain dep = do let opts = info (helper <*> pOptions) ( fullDesc- <> progDesc "Print a greeting for TARGET"- <> header "hello - a test for optparse-applicative" + <> progDesc "twitch"+ <> header "a file watcher" ) options <- execParser opts defaultMainWithOptions options dep
twitch.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: twitch-version: 0.1.3.0+version: 0.1.4.0 synopsis: A high level file watcher DSL description: Twitch is a monadic DSL and library for file watching. @@ -36,9 +36,8 @@ cabal-version: >=1.10 library- exposed-modules: Twitch + exposed-modules: Twitch, Twitch.InternalRule other-modules: Twitch.Internal- , Twitch.InternalRule , Twitch.Main , Twitch.Path , Twitch.Rule