2010-12-31 00:08:22 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.InAnnex where
|
|
|
|
|
2011-10-05 20:02:51 +00:00
|
|
|
import Common.Annex
|
2010-12-31 00:08:22 +00:00
|
|
|
import Command
|
2011-10-04 04:40:47 +00:00
|
|
|
import Annex.Content
|
2010-12-31 00:08:22 +00:00
|
|
|
|
2011-10-29 19:19:05 +00:00
|
|
|
def :: [Command]
|
2012-02-14 16:40:40 +00:00
|
|
|
def = [oneShot $ command "inannex" (paramRepeating paramKey) seek
|
2011-10-29 19:19:05 +00:00
|
|
|
"checks if keys are present in the annex"]
|
2010-12-31 00:08:22 +00:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withKeys start]
|
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: Key -> CommandStart
|
2011-11-09 22:33:15 +00:00
|
|
|
start key = inAnnexSafe key >>= dispatch
|
|
|
|
where
|
|
|
|
dispatch (Just True) = stop
|
|
|
|
dispatch (Just False) = exit 1
|
|
|
|
dispatch Nothing = exit 100
|
|
|
|
exit n = liftIO $ exitWith $ ExitFailure n
|