init: Added --no-autoenable option
Someone may disagree with what repositories are set to autoenable and it's good to have local overrides. See https://github.com/datalad/datalad/issues/6634 Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
parent
cac752d720
commit
0d50c90794
3 changed files with 18 additions and 2 deletions
|
@ -25,6 +25,7 @@ data InitOptions = InitOptions
|
|||
{ initDesc :: String
|
||||
, initVersion :: Maybe RepoVersion
|
||||
, autoEnableOnly :: Bool
|
||||
, noAutoEnable :: Bool
|
||||
}
|
||||
|
||||
optParser :: CmdParamsDesc -> Parser InitOptions
|
||||
|
@ -38,6 +39,10 @@ optParser desc = InitOptions
|
|||
( long "autoenable"
|
||||
<> help "only enable special remotes configured with autoenable=true"
|
||||
)
|
||||
<*> switch
|
||||
( long "no-autoenable"
|
||||
<> help "do not enable special remotes configured with autoenable=true"
|
||||
)
|
||||
|
||||
parseRepoVersion :: MonadFail m => String -> m RepoVersion
|
||||
parseRepoVersion s = case RepoVersion <$> readish s of
|
||||
|
@ -73,7 +78,8 @@ perform os = do
|
|||
initialize False
|
||||
(if null (initDesc os) then Nothing else Just (initDesc os))
|
||||
(initVersion os)
|
||||
Annex.SpecialRemote.autoEnable
|
||||
unless (noAutoEnable os)
|
||||
Annex.SpecialRemote.autoEnable
|
||||
next $ return True
|
||||
|
||||
performAutoEnableOnly :: CommandPerform
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue