Add plumbing-level lookupkey command.
This commit is contained in:
parent
f0cf4d1861
commit
7d5b25515c
5 changed files with 37 additions and 1 deletions
26
Command/LookupKey.hs
Normal file
26
Command/LookupKey.hs
Normal file
|
@ -0,0 +1,26 @@
|
|||
{- 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 $
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue