data SyncOptions = SyncOptions
{ syncWith :: CmdParams
, commitOption :: Bool
+ , noCommitOption :: Bool
, messageOption :: Maybe String
, pullOption :: Bool
, pushOption :: Bool
( metavar desc
<> completeRemotes
))
- <*> invertableSwitch "commit" True
- ( help "avoid git commit"
+ <*> switch
+ ( long "commit"
+ <> help "commit changes to git"
+ )
+ <*> switch
+ ( long "no-commit"
+ <> help "avoid git commit"
)
<*> optional (strOption
( long "message" <> short 'm' <> metavar "MSG"
)
where
shouldcommit = pure (commitOption o)
- <&&> getGitConfigVal annexAutoCommit
+ <||> (pure (not (noCommitOption o)) <&&> getGitConfigVal annexAutoCommit)
commitMsg :: Annex String
commitMsg = do