2010-11-02 19:04:24 -04:00
|
|
|
{- 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 16:02:51 -04:00
|
|
|
import Common.Annex
|
2010-11-02 19:04:24 -04:00
|
|
|
import Command
|
2011-08-17 14:14:43 -04:00
|
|
|
import Init
|
2010-12-30 15:06:26 -04:00
|
|
|
|
2011-10-29 15:19:05 -04:00
|
|
|
def :: [Command]
|
|
|
|
def = [dontCheck repoExists $
|
|
|
|
command "init" paramDesc seek "initialize git-annex"]
|
2010-11-02 19:04:24 -04:00
|
|
|
|
2010-12-30 14:19:16 -04:00
|
|
|
seek :: [CommandSeek]
|
2011-05-16 12:25:54 -04:00
|
|
|
seek = [withWords start]
|
2010-11-11 18:54:52 -04:00
|
|
|
|
2011-09-15 16:50:49 -04:00
|
|
|
start :: [String] -> CommandStart
|
2011-05-16 12:25:54 -04:00
|
|
|
start ws = do
|
2010-11-02 19:04:24 -04:00
|
|
|
showStart "init" description
|
2011-05-15 02:02:46 -04:00
|
|
|
next $ perform description
|
2011-05-16 12:25:54 -04:00
|
|
|
where
|
|
|
|
description = unwords ws
|
2010-11-02 19:04:24 -04:00
|
|
|
|
2010-12-30 14:19:16 -04:00
|
|
|
perform :: String -> CommandPerform
|
2010-11-02 19:04:24 -04:00
|
|
|
perform description = do
|
2011-11-12 15:42:52 -04:00
|
|
|
initialize $ if null description then Nothing else Just description
|
2011-06-22 16:03:26 -04:00
|
|
|
next $ return True
|