2010-12-31 00:08:22 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2010 Joey Hess <id@joeyh.name>
|
2010-12-31 00:08:22 +00:00
|
|
|
-
|
2019-03-13 19:48:14 +00:00
|
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
2010-12-31 00:08:22 +00:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.InAnnex where
|
|
|
|
|
|
|
|
import Command
|
2011-10-04 04:40:47 +00:00
|
|
|
import Annex.Content
|
2010-12-31 00:08:22 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
2015-07-08 19:08:02 +00:00
|
|
|
cmd = noCommit $
|
|
|
|
command "inannex" SectionPlumbing
|
|
|
|
"checks if keys are present in the annex"
|
|
|
|
(paramRepeating paramKey)
|
|
|
|
(withParams seek)
|
2010-12-31 00:08:22 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
seek :: CmdParams -> CommandSeek
|
2018-10-01 18:12:06 +00:00
|
|
|
seek = withKeys (commandAction . start)
|
2010-12-31 00:08:22 +00:00
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: Key -> CommandStart
|
2011-11-09 22:33:15 +00:00
|
|
|
start key = inAnnexSafe key >>= dispatch
|
2012-11-12 05:05:04 +00:00
|
|
|
where
|
|
|
|
dispatch (Just True) = stop
|
|
|
|
dispatch (Just False) = exit 1
|
|
|
|
dispatch Nothing = exit 100
|
|
|
|
exit n = liftIO $ exitWith $ ExitFailure n
|