aboutsummaryrefslogtreecommitdiff
path: root/Command/Adjust.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-03-29 11:54:18 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-03-29 11:54:18 -0400
commit3b7202cb47f89547e09f6fd219d73c88d4e52bc6 (patch)
treec9006326e9701fb10965b2157bbf126d11fc9d76 /Command/Adjust.hs
parent4e12a0146f3d76282b2f406f4fcb377450085447 (diff)
option parser for adjust command
Diffstat (limited to 'Command/Adjust.hs')
-rw-r--r--Command/Adjust.hs28
1 files changed, 20 insertions, 8 deletions
diff --git a/Command/Adjust.hs b/Command/Adjust.hs
index 766f608f8..7646cfa57 100644
--- a/Command/Adjust.hs
+++ b/Command/Adjust.hs
@@ -12,14 +12,26 @@ import Annex.AdjustedBranch
cmd :: Command
cmd = notBareRepo $ notDirect $
- command "adjust" SectionSetup "adjust branch"
- paramNothing (withParams seek)
+ command "adjust" SectionSetup "enter adjusted branch"
+ paramNothing (seek <$$> optParser)
-seek :: CmdParams -> CommandSeek
-seek = withWords start
+optParser :: CmdParamsDesc -> Parser Adjustment
+optParser _ =
+ flag' UnlockAdjustment
+ ( long "unlock"
+ <> help "unlock annexed files"
+ )
+ {- Not ready yet
+ <|> flag' HideMissingAdjustment
+ ( long "hide-missing"
+ <> help "omit annexed files whose content is not present"
+ )
+ -}
-start :: [String] -> CommandStart
-start [] = do
- enterAdjustedBranch HideMissingAdjustment
+seek :: Adjustment -> CommandSeek
+seek = commandAction . start
+
+start :: Adjustment -> CommandStart
+start adj = do
+ enterAdjustedBranch adj
next $ next $ return True
-start _ = error "Unknown parameter"