git-annex/Command/InAnnex.hs

28 lines
608 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.InAnnex where
2011-10-05 20:02:51 +00:00
import Common.Annex
import Command
2011-10-04 04:40:47 +00:00
import Annex.Content
def :: [Command]
2012-09-16 00:46:38 +00:00
def = [noCommit $ command "inannex" (paramRepeating paramKey) seek
"checks if keys are present in the annex"]
seek :: [CommandSeek]
seek = [withKeys start]
start :: Key -> CommandStart
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