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