aboutsummaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-09 16:05:45 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-09 16:05:45 -0400
commit525e04af35bb588b4f8a8721cfa77b2b285ac914 (patch)
tree9d00a7d7066a8ad30c9e6313706d47de2609f82a /Command/Fsck.hs
parent87896574f32be5aa1636facc494faeab34cd0845 (diff)
wip
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index dbeeefbcd..0c5251ecb 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -34,7 +34,6 @@ import Types.CleanupActions
import Utility.HumanTime
import Utility.CopyFile
import Git.FilePath
-import Git.Types (RemoteName)
import Utility.PID
import qualified Database.Fsck as FsckDb
@@ -48,11 +47,13 @@ cmd = command "fsck" SectionMaintenance
data FsckOptions = FsckOptions
{ fsckFiles :: CmdParams
- , fsckFromOption :: Maybe RemoteName
+ , fsckFromOption :: Maybe (DeferredParse Remote)
, incrementalOpt :: Maybe IncrementalOpt
, keyOptions :: Maybe KeyOptions
}
+-- TODO: annexedMatchingOptions
+
data IncrementalOpt
= StartIncrementalO
| MoreIncrementalO
@@ -61,7 +62,7 @@ data IncrementalOpt
optParser :: CmdParamsDesc -> Parser FsckOptions
optParser desc = FsckOptions
<$> cmdParams desc
- <*> optional (strOption
+ <*> optional (parseRemoteOption $ strOption
( long "from" <> short 'f' <> metavar paramRemote
<> help "check remote"
))
@@ -82,11 +83,9 @@ optParser desc = FsckOptions
<> help "schedule incremental fscking"
))
--- TODO: annexedMatchingOptions
-
seek :: FsckOptions -> CommandSeek
seek o = do
- from <- Remote.byNameWithUUID (fsckFromOption o)
+ from <- maybe (pure Nothing) (Just <$$> getParsed) (fsckFromOption o)
u <- maybe getUUID (pure . Remote.uuid) from
i <- prepIncremental u (incrementalOpt o)
withKeyOptions (keyOptions o) False