Add commandline flag --no-user-config
Stops brittany from trying to read a user-global config flag. Together with --config-file, this can be used to pass one single config to brittany, thereby controlling exactly and explicit what the inputs of brittany are. Should be useful for testing stuff that might depend on config.remotes/felixonmars/release
parent
033fdc6517
commit
4de2862a04
|
@ -146,6 +146,7 @@ mainCmdParser helpDesc = do
|
|||
printHelp <- addSimpleBoolFlag "h" ["help"] mempty
|
||||
printVersion <- addSimpleBoolFlag "" ["version"] mempty
|
||||
printLicense <- addSimpleBoolFlag "" ["license"] mempty
|
||||
noUserConfig <- addSimpleBoolFlag "" ["no-user-config"] mempty
|
||||
configPaths <- addFlagStringParams ""
|
||||
["config-file"]
|
||||
"PATH"
|
||||
|
@ -217,7 +218,11 @@ mainCmdParser helpDesc = do
|
|||
else pure configPaths
|
||||
|
||||
config <-
|
||||
runMaybeT (readConfigsWithUserConfig cmdlineConfig configsToLoad)
|
||||
runMaybeT
|
||||
(if noUserConfig
|
||||
then readConfigs cmdlineConfig configsToLoad
|
||||
else readConfigsWithUserConfig cmdlineConfig configsToLoad
|
||||
)
|
||||
>>= \case
|
||||
Nothing -> System.Exit.exitWith (System.Exit.ExitFailure 53)
|
||||
Just x -> return x
|
||||
|
|
Loading…
Reference in New Issue