find: New subcommand.
This commit is contained in:
parent
54d0f73e67
commit
a5c4dd9743
5 changed files with 47 additions and 0 deletions
24
Command/Find.hs
Normal file
24
Command/Find.hs
Normal file
|
@ -0,0 +1,24 @@
|
|||
{- git-annex command
|
||||
-
|
||||
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Command.Find where
|
||||
|
||||
import Control.Monad (when)
|
||||
import Control.Monad.State (liftIO)
|
||||
|
||||
import Command
|
||||
import Core
|
||||
|
||||
seek :: [SubCmdSeek]
|
||||
seek = [withDefault "." withFilesInGit start]
|
||||
|
||||
{- Output a list of files. -}
|
||||
start :: SubCmdStartString
|
||||
start file = isAnnexed file $ \(key, _) -> do
|
||||
exists <- inAnnex key
|
||||
when (exists) $ liftIO $ putStrLn file
|
||||
return Nothing
|
Loading…
Add table
Add a link
Reference in a new issue