diff options
| -rw-r--r-- | Main.hs | 63 | ||||
| -rw-r--r-- | git-auto-acp.cabal | 3 |
2 files changed, 52 insertions, 14 deletions
@@ -6,21 +6,58 @@ module Main where import Data.Version (showVersion) import Paths_git_auto_acp (version) +import Control.Applicative ((<|>), some) import Control.Concurrent -import Control.Monad -import Data.Foldable -import Data.Maybe -import qualified Data.Set as S + ( forkIO + , newChan + , newEmptyMVar + , putMVar + , readChan + , takeMVar + , threadDelay + , writeChan + ) +import Control.Monad (unless, void) +import Data.Foldable (asum, for_) +import Data.Maybe (fromMaybe) +import qualified Data.Set as S (Set, empty, insert, null) import Options.Applicative + ( Parser + , auto + , customExecParser + , flag' + , footer + , fullDesc + , header + , help + , helper + , info + , long + , metavar + , option + , prefs + , short + , showDefault + , showHelpOnEmpty + , simpleVersioner + , strOption + , value + ) import System.Clock -import System.Environment -import System.Exit -import System.FSNotify -import System.FSNotify.Devel -import System.FilePath -import System.IO -import System.Posix.Signals -import System.Process + ( Clock(Monotonic) + , TimeSpec + , diffTimeSpec + , getTime + , toNanoSecs + ) +import System.Environment (lookupEnv) +import System.Exit (ExitCode(ExitSuccess)) +import System.FSNotify (watchTree, withManager) +import System.FSNotify.Devel (allEvents) +import System.FilePath (splitDirectories) +import System.IO (hPutStrLn, stderr) +import System.Posix.Signals (Handler(Catch), installHandler, sigINT) +import System.Process (rawSystem) data Watch = Watch { watchPath :: FilePath @@ -125,7 +162,7 @@ main = do o <- customExecParser (prefs $ showHelpOnEmpty) $ info - (opts <**> helper <**> simpleVersioner (showVersion version)) + (simpleVersioner (showVersion version) <*> helper <*> opts) (fullDesc <> header "git-auto-acp -- automatically add-commit-push files" <> (footer diff --git a/git-auto-acp.cabal b/git-auto-acp.cabal index ba24d89..1f56ede 100644 --- a/git-auto-acp.cabal +++ b/git-auto-acp.cabal @@ -18,7 +18,8 @@ extra-doc-files: -- extra-source-files: common warnings - ghc-options: -Wall + -- sometimes useful: -ddump-minimal-imports + ghc-options: -Wall -Wmissing-import-lists -Wunused-imports executable git-auto-acp import: warnings |
