git-annex/Command/Init.hs

32 lines
648 B
Haskell
Raw Normal View History

{- git-annex command
-
- Copyright 2010 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Init where
2011-10-05 20:02:51 +00:00
import Common.Annex
import Command
import Init
def :: [Command]
def = [dontCheck repoExists $
command "init" paramDesc seek "initialize git-annex"]
seek :: [CommandSeek]
seek = [withWords start]
2010-11-11 22:54:52 +00:00
start :: [String] -> CommandStart
start ws = do
showStart "init" description
2011-05-15 06:02:46 +00:00
next $ perform description
2012-11-12 05:05:04 +00:00
where
description = unwords ws
perform :: String -> CommandPerform
perform description = do
initialize $ if null description then Nothing else Just description
next $ return True