From a5c4dd974396d1dc9c3e55381215a904fa997cd2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 14 Nov 2010 12:35:05 -0400 Subject: find: New subcommand. --- Command/Find.hs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Command/Find.hs (limited to 'Command/Find.hs') 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 + - + - 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 -- cgit v1.2.3