git-annex/Command/InAnnex.hs

28 lines
621 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 16:02:51 -04:00
import Common.Annex
import Command
2011-10-04 00:40:47 -04:00
import Annex.Content
def :: [Command]
2012-09-15 20:46:38 -04:00
def = [noCommit $ command "inannex" (paramRepeating paramKey) seek
SectionPlumbing "checks if keys are present in the annex"]
seek :: [CommandSeek]
seek = [withKeys start]
start :: Key -> CommandStart
start key = inAnnexSafe key >>= dispatch
2012-11-12 01:05:04 -04:00
where
dispatch (Just True) = stop
dispatch (Just False) = exit 1
dispatch Nothing = exit 100
exit n = liftIO $ exitWith $ ExitFailure n