Merge branch 'master' into bs
and update changelog
This commit is contained in:
commit
7d9dff5b05
16 changed files with 263 additions and 48 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue