git-annex/Command/LookupKey.hs

27 lines
574 B
Haskell
Raw Normal View History

2013-12-15 18:02:23 +00:00
{- git-annex command
-
- Copyright 2013 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.LookupKey where
import Common.Annex
import Command
import Annex.CatFile
import Types.Key
def :: [Command]
def = [notBareRepo $ noCommit $ noMessages $
2013-12-15 18:02:23 +00:00
command "lookupkey" (paramRepeating paramFile) seek
SectionPlumbing "looks up key used for file"]
seek :: [CommandSeek]
seek = [withStrings start]
start :: String -> CommandStart
start file = do
liftIO . maybe exitFailure (putStrLn . key2file) =<< catKeyFile file
stop