summaryrefslogtreecommitdiff
path: root/Command/Find.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Find.hs')
-rw-r--r--Command/Find.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Command/Find.hs b/Command/Find.hs
new file mode 100644
index 000000000..db0589fea
--- /dev/null
+++ b/Command/Find.hs
@@ -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