a2ba701056
This is a work in progress. It compiles and is able to do basic command dispatch, including git autocorrection, while using optparse-applicative for the core commandline parsing. * Many commands are temporarily disabled before conversion. * Options are not wired in yet. * cmdnorepo actions don't work yet. Also, removed the [Command] list, which was only used in one place.
28 lines
640 B
Haskell
28 lines
640 B
Haskell
{- git-annex command
|
|
-
|
|
- Copyright 2010 Joey Hess <id@joeyh.name>
|
|
-
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
-}
|
|
|
|
module Command.InAnnex where
|
|
|
|
import Common.Annex
|
|
import Command
|
|
import Annex.Content
|
|
|
|
cmd :: Command
|
|
cmd = noCommit $ command "inannex" (paramRepeating paramKey)
|
|
SectionPlumbing "checks if keys are present in the annex"
|
|
(commandParser seek)
|
|
|
|
seek :: CmdParams -> 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
|