option parser for adjust command
This commit is contained in:
parent
4c9ca98769
commit
f4dd3fbb68
1 changed files with 20 additions and 8 deletions
|
@ -12,14 +12,26 @@ import Annex.AdjustedBranch
|
||||||
|
|
||||||
cmd :: Command
|
cmd :: Command
|
||||||
cmd = notBareRepo $ notDirect $
|
cmd = notBareRepo $ notDirect $
|
||||||
command "adjust" SectionSetup "adjust branch"
|
command "adjust" SectionSetup "enter adjusted branch"
|
||||||
paramNothing (withParams seek)
|
paramNothing (seek <$$> optParser)
|
||||||
|
|
||||||
seek :: CmdParams -> CommandSeek
|
optParser :: CmdParamsDesc -> Parser Adjustment
|
||||||
seek = withWords start
|
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
|
seek :: Adjustment -> CommandSeek
|
||||||
start [] = do
|
seek = commandAction . start
|
||||||
enterAdjustedBranch HideMissingAdjustment
|
|
||||||
|
start :: Adjustment -> CommandStart
|
||||||
|
start adj = do
|
||||||
|
enterAdjustedBranch adj
|
||||||
next $ next $ return True
|
next $ next $ return True
|
||||||
start _ = error "Unknown parameter"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue