summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-14 12:35:05 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-14 12:35:05 -0400
commita5c4dd974396d1dc9c3e55381215a904fa997cd2 (patch)
tree8f7f98fab145050b7f99ffe3358a7b616f171dd9 /Command
parent54d0f73e67135ec675953d608d0780dfbb130f5d (diff)
find: New subcommand.
Diffstat (limited to 'Command')
-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