git-annex/git-annex.hs

35 lines
620 B
Haskell
Raw Normal View History

{- git-annex main program stub
2010-10-27 16:53:54 -04:00
-
- Copyright 2010-2013 Joey Hess <joey@kitenet.net>
2010-10-27 16:53:54 -04:00
-
- Licensed under the GNU GPL version 3 or higher.
-}
2010-10-10 00:18:16 -04:00
{-# LANGUAGE CPP #-}
import System.Environment
import System.FilePath
2010-10-16 16:20:49 -04:00
import qualified GitAnnex
import qualified GitAnnexShell
2013-02-27 16:33:20 -04:00
#ifdef WITH_TESTSUITE
import qualified Test
#endif
2010-10-31 14:32:18 -04:00
main :: IO ()
main = run =<< getProgName
2012-11-11 00:51:07 -04:00
where
run n
| isshell n = go GitAnnexShell.run
| otherwise = go GitAnnex.run
isshell n = takeFileName n == "git-annex-shell"
go a = do
ps <- getArgs
2013-05-17 16:45:44 -04:00
#ifdef WITH_TESTSUITE
if ps == ["test"]
then Test.main
else a ps
#else
a ps
#endif