git-annex/git-annex.hs

35 lines
660 B
Haskell
Raw Normal View History

{- git-annex main program stub
2010-10-27 20:53:54 +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
{-# LANGUAGE CPP #-}
import System.Environment
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
import qualified Test
#endif
2010-10-31 18:32:18 +00:00
main :: IO ()
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"
go a = do
ps <- getArgs
2013-05-17 20:45:44 +00:00
#ifdef WITH_TESTSUITE
case ps of
("test":ps') -> Test.main ps'
_ -> a ps
#else
a ps
#endif