diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-03 12:37:12 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-03 12:37:12 -0400 |
commit | 508517de485e77196a8d8e33558f4185c50dea96 (patch) | |
tree | 319fc6e63da144e40dd124a07f4bb6c0ad25c5ee /Command/Move.hs | |
parent | 019733f00d01301d71acc46245d2dc130934d951 (diff) |
get, move, copy, mirror: Added --failed switch which retries failed copies/moves
Note that get --from foo --failed will get things that a previous get --from bar
tried and failed to get, etc. I considered making --failed only retry
transfers from the same remote, but it was easier, and seems more useful,
to not have the same remote requirement.
Noisy due to some refactoring into Types/
Diffstat (limited to 'Command/Move.hs')
-rw-r--r-- | Command/Move.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Move.hs b/Command/Move.hs index 88ca4e01d..bf2aa0a24 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -35,7 +35,7 @@ optParser :: CmdParamsDesc -> Parser MoveOptions optParser desc = MoveOptions <$> cmdParams desc <*> parseFromToOptions - <*> optional (parseKeyOptions False) + <*> optional (parseKeyOptions <|> parseFailedTransfersOption) instance DeferredParseClass MoveOptions where finishParse v = MoveOptions @@ -61,8 +61,10 @@ startKey o move = start' o move Nothing start' :: MoveOptions -> Bool -> AssociatedFile -> Key -> ActionItem -> CommandStart start' o move afile key ai = case fromToOptions o of - FromRemote src -> fromStart move afile key ai =<< getParsed src - ToRemote dest -> toStart move afile key ai =<< getParsed dest + FromRemote src -> checkFailedTransferDirection ai Download $ + fromStart move afile key ai =<< getParsed src + ToRemote dest -> checkFailedTransferDirection ai Upload $ + toStart move afile key ai =<< getParsed dest showMoveAction :: Bool -> Key -> ActionItem -> Annex () showMoveAction move = showStart' (if move then "move" else "copy") |