mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-09 04:25:38 +08:00
TUN-3715: Only read config file once, right before invoking the command
This commit is contained in:
@@ -2,6 +2,7 @@ package cliutil
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
@@ -21,7 +22,7 @@ func UsageError(format string, args ...interface{}) error {
|
||||
}
|
||||
|
||||
// Ensures exit with error code if actionFunc returns an error
|
||||
func ErrorHandler(actionFunc cli.ActionFunc) cli.ActionFunc {
|
||||
func WithErrorHandler(actionFunc cli.ActionFunc) cli.ActionFunc {
|
||||
return func(ctx *cli.Context) error {
|
||||
err := actionFunc(ctx)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user