summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-26 14:26:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-26 14:26:32 -0400
commit9b6cc6f06084d592242da171f00af256b3354841 (patch)
tree127e18c01a564294695097cb88b246baef569ce2
parentbe157906efca7766c14147218fa30c8575c0c4a7 (diff)
whereis: Support --all.
-rw-r--r--Command/Whereis.hs18
-rw-r--r--debian/changelog1
2 files changed, 15 insertions, 4 deletions
diff --git a/Command/Whereis.hs b/Command/Whereis.hs
index 4030cf2f8..0083f8c5c 100644
--- a/Command/Whereis.hs
+++ b/Command/Whereis.hs
@@ -14,20 +14,30 @@ import Command
import Remote
import Logs.Trust
import GitAnnex.Options
+import Types.Key
def :: [Command]
-def = [noCommit $ withOptions [jsonOption] $
+def = [noCommit $ withOptions (jsonOption : keyOptions) $
command "whereis" paramPaths seek SectionQuery
"lists repositories that have file content"]
seek :: CommandSeek
seek ps = do
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 remotemap file (key, _) = do
- showStart "whereis" file
+start remotemap file (key, _) = start' remotemap key (Just 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
perform :: M.Map UUID Remote -> Key -> CommandPerform
diff --git a/debian/changelog b/debian/changelog
index d3ef17dd1..1caaf4335 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,7 @@ git-annex (5.20140118) UNRELEASED; urgency=medium
http remote.
* webapp: After upgrading a git repository to git-annex, fix
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