master > master: code go - cleanup von cli + option, um checks ein+auszuschalten
This commit is contained in:
@@ -24,9 +24,10 @@ var (
|
||||
//go:embed assets/*
|
||||
res embed.FS
|
||||
assets = map[string]string{
|
||||
"version": "assets/VERSION",
|
||||
"logo": "assets/LOGO",
|
||||
"help": "assets/HELP",
|
||||
"appconfig": "assets/config.yml",
|
||||
"version": "assets/VERSION",
|
||||
"logo": "assets/LOGO",
|
||||
"help": "assets/HELP",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -38,25 +39,34 @@ func main() {
|
||||
var err error
|
||||
var arguments *types.CliArguments
|
||||
|
||||
// set assets
|
||||
// assets festlegen
|
||||
setup.Res = res
|
||||
setup.Assets = assets
|
||||
|
||||
// parse cli arguments
|
||||
// cli arguments parsen
|
||||
arguments, err = cli.ParseCli(os.Args)
|
||||
|
||||
// initialise logging options
|
||||
// initialisiere basic optionen wie Logging
|
||||
if err == nil {
|
||||
logging.SetQuietMode(*arguments.Quiet)
|
||||
logging.SetDebugMode(*arguments.Debug)
|
||||
logging.SetQuietMode(arguments.QuietModeOn())
|
||||
logging.SetDebugMode(arguments.DebugModeOn())
|
||||
logging.SetAnsiMode(arguments.ShowColour())
|
||||
}
|
||||
|
||||
// app config (intern) intialisieren
|
||||
if err == nil {
|
||||
err = setup.AppConfigInitialise()
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
setup.AppConfig.Options.Checks = arguments.ShowChecks()
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
if arguments.Version.Happened() {
|
||||
endpoints.Version()
|
||||
} else if arguments.Run.Happened() {
|
||||
err = endpoints.Run(*arguments.ConfigFile)
|
||||
err = endpoints.Run(arguments.GetConfigFile())
|
||||
} else { // } else if arguments.Help.Happened() {
|
||||
endpoints.Help()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user