Merge branch 'master' into bs

and update changelog
This commit is contained in:
Joey Hess 2019-12-18 15:13:30 -04:00
commit 7d9dff5b05
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
16 changed files with 263 additions and 48 deletions

View file

@ -19,24 +19,24 @@ cmd = noCommit $ noMessages $ command "inprogress" SectionQuery
data InprogressOptions = InprogressOptions
{ inprogressFiles :: CmdParams
, allOption :: Bool
, keyOptions :: Maybe KeyOptions
}
optParser :: CmdParamsDesc -> Parser InprogressOptions
optParser desc = InprogressOptions
<$> cmdParams desc
<*> switch
( long "all"
<> short 'A'
<> help "access all files currently being downloaded"
)
<*> optional (parseAllOption <|> parseSpecificKeyOption)
seek :: InprogressOptions -> CommandSeek
seek o = do
ts <- map (transferKey . fst) <$> getTransfers
if allOption o
then forM_ ts $ commandAction . start'
else do
case keyOptions o of
Just WantAllKeys ->
forM_ ts $ commandAction . start'
Just (WantSpecificKey k)
| k `elem` ts -> commandAction (start' k)
| otherwise -> commandAction stop
_ -> do
let s = S.fromList ts
withFilesInGit
(commandAction . (whenAnnexed (start s)))