diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-07-10 16:32:33 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-07-10 16:32:33 -0400 |
commit | 44956f3f6c58b253c188ce12a170a30dbdc06fe1 (patch) | |
tree | e9e5bc3a1c228ff406c0e8823a19e1e732949f59 /Command | |
parent | fc65981e5950f151da1b9e5b30575e6d77b8d187 (diff) |
convert Whereis
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Whereis.hs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Command/Whereis.hs b/Command/Whereis.hs index 2c6018b24..3610eed78 100644 --- a/Command/Whereis.hs +++ b/Command/Whereis.hs @@ -19,21 +19,25 @@ cmd :: Command cmd = noCommit $ withGlobalOptions (jsonOption : annexedMatchingOptions) $ command "whereis" SectionQuery "lists repositories that have file content" - paramPaths (withParams seek) + paramPaths (seek <$$> optParser) data WhereisOptions = WhereisOptions { whereisFiles :: CmdParams - , jsonOption :: GlobalSetter , keyOptions :: Maybe KeyOptions } -seek :: CmdParams -> CommandSeek -seek ps = do +optParser :: CmdParamsDesc -> Parser WhereisOptions +optParser desc = WhereisOptions + <$> cmdParams desc + <*> optional (parseKeyOptions False) + +seek :: WhereisOptions -> CommandSeek +seek o = do m <- remoteMap id - withKeyOptions False + withKeyOptions (keyOptions o) False (startKeys m) (withFilesInGit $ whenAnnexed $ start m) - ps + (whereisFiles o) start :: M.Map UUID Remote -> FilePath -> Key -> CommandStart start remotemap file key = start' remotemap key (Just file) |