mirror of
https://github.com/caddyserver/caddy.git
synced 2026-01-17 01:30:34 +00:00
cmd: Use a factory to create the caddy root command (#6533)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
This commit is contained in:
@@ -72,7 +72,7 @@ func Main() {
|
||||
caddy.Log().Warn("failed to set GOMAXPROCS", zap.Error(err))
|
||||
}
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
if err := defaultFactory.Build().Execute(); err != nil {
|
||||
var exitError *exitError
|
||||
if errors.As(err, &exitError) {
|
||||
os.Exit(exitError.ExitCode)
|
||||
|
||||
Reference in New Issue
Block a user