2011-01-07 06:15:23 +00:00
|
|
|
{- git-annex main program stub
|
2010-10-27 20:53:54 +00:00
|
|
|
-
|
2013-02-27 19:48:26 +00:00
|
|
|
- Copyright 2010-2013 Joey Hess <joey@kitenet.net>
|
2010-10-27 20:53:54 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
2010-10-10 04:18:16 +00:00
|
|
|
|
2013-02-27 19:59:31 +00:00
|
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
|
2010-12-30 20:52:24 +00:00
|
|
|
import System.Environment
|
2012-03-15 16:00:19 +00:00
|
|
|
import System.FilePath
|
2010-10-16 20:20:49 +00:00
|
|
|
|
2014-01-26 20:25:55 +00:00
|
|
|
import qualified CmdLine.GitAnnex
|
|
|
|
import qualified CmdLine.GitAnnexShell
|
2013-02-27 20:33:20 +00:00
|
|
|
#ifdef WITH_TESTSUITE
|
2013-02-27 19:48:26 +00:00
|
|
|
import qualified Test
|
2013-02-27 19:59:31 +00:00
|
|
|
#endif
|
2011-03-08 22:05:20 +00:00
|
|
|
|
2010-10-31 18:32:18 +00:00
|
|
|
main :: IO ()
|
2012-03-15 16:00:19 +00:00
|
|
|
main = run =<< getProgName
|
2012-11-11 04:51:07 +00:00
|
|
|
where
|
|
|
|
run n
|
2014-01-26 20:25:55 +00:00
|
|
|
| isshell n = go CmdLine.GitAnnexShell.run
|
|
|
|
| otherwise = go CmdLine.GitAnnex.run
|
2012-11-11 04:51:07 +00:00
|
|
|
isshell n = takeFileName n == "git-annex-shell"
|
2013-02-27 19:48:26 +00:00
|
|
|
go a = do
|
|
|
|
ps <- getArgs
|
2013-05-17 20:45:44 +00:00
|
|
|
#ifdef WITH_TESTSUITE
|
2014-01-21 04:08:43 +00:00
|
|
|
case ps of
|
|
|
|
("test":ps') -> Test.main ps'
|
|
|
|
_ -> a ps
|
2013-02-27 19:59:31 +00:00
|
|
|
#else
|
|
|
|
a ps
|
|
|
|
#endif
|