diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-14 12:35:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-14 12:35:05 -0400 |
commit | a5c4dd974396d1dc9c3e55381215a904fa997cd2 (patch) | |
tree | 8f7f98fab145050b7f99ffe3358a7b616f171dd9 /Command | |
parent | 54d0f73e67135ec675953d608d0780dfbb130f5d (diff) |
find: New subcommand.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Find.hs | 24 |
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 |