MCPcopy Index your code
hub / github.com/foxcpp/maddy / RunWithoutExit

Function RunWithoutExit

internal/cli/app.go:87–98  ·  view source on GitHub ↗

RunWithoutExit is like Run but returns exit code instead of calling os.Exit To be used in maddy.cover.

()

Source from the content-addressed store, hash-verified

85// RunWithoutExit is like Run but returns exit code instead of calling os.Exit
86// To be used in maddy.cover.
87func RunWithoutExit() int {
88 code := 0
89
90 cli.OsExiter = func(c int) { code = c }
91 defer func() {
92 cli.OsExiter = os.Exit
93 }()
94
95 Run()
96
97 return code
98}
99
100func Run() {
101 mapStdlibFlags(app)

Callers

nothing calls this directly

Calls 1

RunFunction · 0.70

Tested by

no test coverage detected