move config parse error logging into function to ensure new lines and don't parse config for help

This commit is contained in:
Willy Kloucek
2022-08-18 08:57:27 +00:00
committed by Willy Kloucek
parent d1f0dbc4c9
commit e58eaabdeb
92 changed files with 241 additions and 526 deletions

View File

@@ -3,9 +3,9 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
"github.com/owncloud/ocis/v2/services/settings/pkg/config"
"github.com/owncloud/ocis/v2/services/settings/pkg/config/parser"
@@ -25,12 +25,7 @@ func Server(cfg *config.Config) *cli.Command {
Usage: fmt.Sprintf("start the %s service without runtime (unsupervised mode)", cfg.Service.Name),
Category: "server",
Before: func(c *cli.Context) error {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
return configlog.LogReturnFatal(parser.ParseConfig(cfg))
},
Action: func(c *cli.Context) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)