support parsing options like --to=here

Reworked remote name parsing to allow things like that. Command.Move
uses it for --to=here, although there's not yet an implementation of
that option.

This commit was sponsored by Ignacio on Patreon.
This commit is contained in:
Joey Hess 2017-05-31 16:20:55 -04:00
parent df880fe815
commit 5ee6912cf3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 32 additions and 22 deletions

View file

@ -52,7 +52,7 @@ start o file key = stopUnless shouldCopy $
| autoMode o = want <||> numCopiesCheck file key (<)
| otherwise = return True
want = case Command.Move.fromToOptions (moveOptions o) of
ToRemote dest -> (Remote.uuid <$> getParsed dest) >>=
Right (ToRemote dest) -> (Remote.uuid <$> getParsed dest) >>=
wantSend False (Just key) (AssociatedFile (Just file))
FromRemote _ ->
Right (FromRemote _) ->
wantGet False (Just key) (AssociatedFile (Just file))