2010-11-14 16:35:05 +00:00
|
|
|
{- 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.State (liftIO)
|
|
|
|
|
|
|
|
import Command
|
2011-01-16 20:05:05 +00:00
|
|
|
import Content
|
2011-08-22 20:14:12 +00:00
|
|
|
import Utility.Conditional
|
2010-11-14 16:35:05 +00:00
|
|
|
|
2010-12-30 19:06:26 +00:00
|
|
|
command :: [Command]
|
2011-03-19 22:58:49 +00:00
|
|
|
command = [repoCommand "find" (paramOptional $ paramRepeating paramPath) seek
|
2010-12-30 19:06:26 +00:00
|
|
|
"lists available files"]
|
|
|
|
|
2010-12-30 18:19:16 +00:00
|
|
|
seek :: [CommandSeek]
|
2011-01-14 03:36:58 +00:00
|
|
|
seek = [withFilesInGit start]
|
2010-11-14 16:35:05 +00:00
|
|
|
|
|
|
|
{- Output a list of files. -}
|
2010-12-30 18:19:16 +00:00
|
|
|
start :: CommandStartString
|
2010-11-14 16:35:05 +00:00
|
|
|
start file = isAnnexed file $ \(key, _) -> do
|
2011-05-17 07:10:13 +00:00
|
|
|
whenM (inAnnex key) $ liftIO $ putStrLn file
|
2011-05-15 06:02:46 +00:00
|
|
|
stop
|