improve types to allow combining some adjustments

Combinations like --hide-misssing --unlocked seem very useful. On the
other hand, combining --fix with --unlock doesn't make sense because a
file can be either unlocked or a symlink that can be fixed, but not
both.

Changed the serialization of HideMissingAdjustment in passing, but it
has not actually been used yet so nothing will be broken.

This commit was sponsored by Trenton Cronholm on Patreon.
This commit is contained in:
Joey Hess 2018-10-18 12:51:20 -04:00
parent 7625cc58ae
commit a6c8de84b6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 106 additions and 44 deletions

View file

@ -17,16 +17,16 @@ cmd = notBareRepo $ notDirect $ noDaemonRunning $
optParser :: CmdParamsDesc -> Parser Adjustment
optParser _ =
flag' UnlockAdjustment
flag' (LinkAdjustment UnlockAdjustment)
( long "unlock"
<> help "unlock annexed files"
)
<|> flag' FixAdjustment
<|> flag' (LinkAdjustment FixAdjustment)
( long "fix"
<> help "fix symlinks to annnexed files"
)
{- Not ready yet
<|> flag' HideMissingAdjustment
<|> flag' (PresenseAdjustment HideMissingAdjustment)
( long "hide-missing"
<> help "omit annexed files whose content is not present"
)