2014-04-17 22:41:24 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2014 Joey Hess <id@joeyh.name>
|
2014-04-17 22:41:24 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.FindRef where
|
|
|
|
|
|
|
|
import Command
|
|
|
|
import qualified Command.Find as Find
|
2017-08-31 16:47:08 +00:00
|
|
|
import qualified Git
|
2014-04-17 22:41:24 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
2018-02-19 18:28:17 +00:00
|
|
|
cmd = withGlobalOptions [nonWorkTreeMatchingOptions] $ Find.mkCommand $
|
2015-07-08 19:08:02 +00:00
|
|
|
command "findref" SectionPlumbing
|
2015-07-08 16:33:27 +00:00
|
|
|
"lists files in a git ref"
|
2015-07-11 00:38:11 +00:00
|
|
|
paramRef (seek <$$> Find.optParser)
|
2014-04-17 22:41:24 +00:00
|
|
|
|
2015-07-11 00:38:11 +00:00
|
|
|
seek :: Find.FindOptions -> CommandSeek
|
2018-10-01 18:12:06 +00:00
|
|
|
seek o = (commandAction . uncurry (Find.start o))
|
|
|
|
`withFilesInRefs` (map Git.Ref $ Find.findThese o)
|