, forcenumcopies :: Maybe NumCopies
, forcemincopies :: Maybe MinCopies
, forcebackend :: Maybe String
+ , useragent :: Maybe String
+ , desktopnotify :: DesktopNotify
}
newAnnexRead :: GitConfig -> IO AnnexRead
, forcebackend = Nothing
, forcenumcopies = Nothing
, forcemincopies = Nothing
+ , useragent = Nothing
+ , desktopnotify = mempty
}
-- Values that can change while running an Annex action.
, fields :: M.Map String String
, cleanupactions :: M.Map CleanupAction (Annex ())
, sentinalstatus :: Maybe SentinalStatus
- , useragent :: Maybe String
, errcounter :: Integer
, skippedfiles :: Bool
, adjustedbranchrefreshcounter :: Integer
, unusedkeys :: Maybe (S.Set Key)
, tempurls :: M.Map Key URLString
, existinghooks :: M.Map Git.Hook.Hook Bool
- , desktopnotify :: DesktopNotify
, workers :: Maybe (TMVar (WorkerPool (AnnexState, AnnexRead)))
, cachedcurrentbranch :: (Maybe (Maybe Git.Branch, Maybe Adjustment))
, cachedgitenv :: Maybe (AltIndexFile, FilePath, [(String, String)])
, fields = M.empty
, cleanupactions = M.empty
, sentinalstatus = Nothing
- , useragent = Nothing
, errcounter = 0
, skippedfiles = False
, adjustedbranchrefreshcounter = 0
, unusedkeys = Nothing
, tempurls = M.empty
, existinghooks = M.empty
- , desktopnotify = mempty
, workers = Nothing
, cachedcurrentbranch = Nothing
, cachedgitenv = Nothing
<> help "override git configuration setting"
<> hidden
)
- , globalOption (setAnnexState . setuseragent) $ strOption
+ , globalOption setuseragent $ strOption
( long "user-agent" <> metavar paramName
<> help "override default User-Agent"
<> hidden
<> help "deprecated, does not trust Amazon Glacier inventory"
<> hidden
)
- , globalFlag (setAnnexState $ setdesktopnotify mkNotifyFinish)
+ , globalFlag (setdesktopnotify mkNotifyFinish)
( long "notify-finish"
<> help "show desktop notification after transfer finishes"
<> hidden
)
- , globalFlag (setAnnexState $ setdesktopnotify mkNotifyStart)
+ , globalFlag (setdesktopnotify mkNotifyStart)
( long "notify-start"
<> help "show desktop notification after transfer starts"
<> hidden
where
setnumcopies n = setAnnexRead $ \rd -> rd { Annex.forcenumcopies = Just $ configuredNumCopies n }
setmincopies n = setAnnexRead $ \rd -> rd { Annex.forcemincopies = Just $ configuredMinCopies n }
- setuseragent v = Annex.changeState $ \s -> s { Annex.useragent = Just v }
+ setuseragent v = setAnnexRead $ \rd -> rd { Annex.useragent = Just v }
+ setdesktopnotify v = setAnnexRead $ \rd -> rd { Annex.desktopnotify = Annex.desktopnotify rd <> v }
setgitconfig v = Annex.addGitConfigOverride v
- setdesktopnotify v = Annex.changeState $ \s -> s { Annex.desktopnotify = Annex.desktopnotify s <> v }
{- Parser that accepts all non-option params. -}
cmdParams :: CmdParamsDesc -> Parser CmdParams