whereis: Support --all.

This commit is contained in:
Joey Hess 2014-01-26 14:26:32 -04:00
parent e72aafac7a
commit 85398d068e
2 changed files with 15 additions and 4 deletions

View file

@ -14,20 +14,30 @@ import Command
import Remote import Remote
import Logs.Trust import Logs.Trust
import GitAnnex.Options import GitAnnex.Options
import Types.Key
def :: [Command] def :: [Command]
def = [noCommit $ withOptions [jsonOption] $ def = [noCommit $ withOptions (jsonOption : keyOptions) $
command "whereis" paramPaths seek SectionQuery command "whereis" paramPaths seek SectionQuery
"lists repositories that have file content"] "lists repositories that have file content"]
seek :: CommandSeek seek :: CommandSeek
seek ps = do seek ps = do
m <- remoteMap id m <- remoteMap id
withFilesInGit (whenAnnexed $ start m) ps withKeyOptions
(startKeys m)
(withFilesInGit $ whenAnnexed $ start m)
ps
start :: M.Map UUID Remote -> FilePath -> (Key, Backend) -> CommandStart start :: M.Map UUID Remote -> FilePath -> (Key, Backend) -> CommandStart
start remotemap file (key, _) = do start remotemap file (key, _) = start' remotemap key (Just file)
showStart "whereis" file
startKeys :: M.Map UUID Remote -> Key -> CommandStart
startKeys remotemap key = start' remotemap key Nothing
start' :: M.Map UUID Remote -> Key -> AssociatedFile -> CommandStart
start' remotemap key afile = do
showStart "whereis" (fromMaybe (key2file key) afile)
next $ perform remotemap key next $ perform remotemap key
perform :: M.Map UUID Remote -> Key -> CommandPerform perform :: M.Map UUID Remote -> Key -> CommandPerform

1
debian/changelog vendored
View file

@ -37,6 +37,7 @@ git-annex (5.20140118) UNRELEASED; urgency=medium
http remote. http remote.
* webapp: After upgrading a git repository to git-annex, fix * webapp: After upgrading a git repository to git-annex, fix
bug that made it temporarily not be synced with. bug that made it temporarily not be synced with.
* whereis: Support --all.
-- Joey Hess <joeyh@debian.org> Sat, 18 Jan 2014 11:54:17 -0400 -- Joey Hess <joeyh@debian.org> Sat, 18 Jan 2014 11:54:17 -0400