summaryrefslogtreecommitdiff
path: root/CmdLine/GitAnnex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-08-03 12:37:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-08-03 12:37:12 -0400
commit508517de485e77196a8d8e33558f4185c50dea96 (patch)
tree319fc6e63da144e40dd124a07f4bb6c0ad25c5ee /CmdLine/GitAnnex
parent019733f00d01301d71acc46245d2dc130934d951 (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 'CmdLine/GitAnnex')
-rw-r--r--CmdLine/GitAnnex/Options.hs49
1 files changed, 27 insertions, 22 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index db2efeda5..64f70d178 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -139,32 +139,37 @@ parseToOption = parseRemoteOption $ strOption
data KeyOptions
= WantAllKeys
| WantUnusedKeys
+ | WantFailedTransfers
| WantSpecificKey Key
| WantIncompleteKeys
| WantBranchKeys [Branch]
-parseKeyOptions :: Bool -> Parser KeyOptions
-parseKeyOptions allowincomplete = if allowincomplete
- then base
- <|> flag' WantIncompleteKeys
- ( long "incomplete"
- <> help "resume previous downloads"
- )
- else base
- where
- base = parseAllOption
- <|> WantBranchKeys <$> some (option (str >>= pure . Ref)
- ( long "branch" <> metavar paramRef
- <> help "operate on files in the specified branch or treeish"
- ))
- <|> flag' WantUnusedKeys
- ( long "unused" <> short 'U'
- <> help "operate on files found by last run of git-annex unused"
- )
- <|> (WantSpecificKey <$> option (str >>= parseKey)
- ( long "key" <> metavar paramKey
- <> help "operate on specified key"
- ))
+parseKeyOptions :: Parser KeyOptions
+parseKeyOptions = parseAllOption
+ <|> WantBranchKeys <$> some (option (str >>= pure . Ref)
+ ( long "branch" <> metavar paramRef
+ <> help "operate on files in the specified branch or treeish"
+ ))
+ <|> flag' WantUnusedKeys
+ ( long "unused" <> short 'U'
+ <> help "operate on files found by last run of git-annex unused"
+ )
+ <|> (WantSpecificKey <$> option (str >>= parseKey)
+ ( long "key" <> metavar paramKey
+ <> help "operate on specified key"
+ ))
+
+parseFailedTransfersOption :: Parser KeyOptions
+parseFailedTransfersOption = flag' WantFailedTransfers
+ ( long "failed"
+ <> help "operate on files that recently failed to be transferred"
+ )
+
+parseIncompleteOption :: Parser KeyOptions
+parseIncompleteOption = flag' WantIncompleteKeys
+ ( long "incomplete"
+ <> help "resume previous downloads"
+ )
parseAllOption :: Parser KeyOptions
parseAllOption = flag' WantAllKeys