2010-12-30 20:08:22 -04: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 16:02:51 -04:00
|
|
|
import Common.Annex
|
2010-12-30 20:08:22 -04:00
|
|
|
import Command
|
2011-10-04 00:40:47 -04:00
|
|
|
import Annex.Content
|
2010-12-30 20:08:22 -04:00
|
|
|
|
2011-10-29 15:19:05 -04:00
|
|
|
def :: [Command]
|
2012-02-14 12:40:40 -04:00
|
|
|
def = [oneShot $ command "inannex" (paramRepeating paramKey) seek
|
2011-10-29 15:19:05 -04:00
|
|
|
"checks if keys are present in the annex"]
|
2010-12-30 20:08:22 -04:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withKeys start]
|
|
|
|
|
2011-09-15 16:50:49 -04:00
|
|
|
start :: Key -> CommandStart
|
2011-11-09 18:33:15 -04: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
|