MCPcopy Create free account
hub / github.com/carvel-dev/kapp-controller / nonExitingMain

Function nonExitingMain

cli/cmd/kctrl/kctrl.go:26–45  ·  view source on GitHub ↗

nonExitingMain does not use os.Exit to make sure Go runs defers

()

Source from the content-addressed store, hash-verified

24
25// nonExitingMain does not use os.Exit to make sure Go runs defers
26func nonExitingMain() error {
27 // TODO logs
28 // TODO log flags used
29
30 confUI := ui.NewConfUI(ui.NewNoopLogger())
31 defer confUI.Flush()
32
33 command := cmd.NewDefaultKctrlCmd(confUI)
34
35 err := command.Execute()
36 if err != nil {
37 confUI.ErrorLinef("kctrl: Error: %v", uierrs.NewMultiLineError(err))
38 return err
39 }
40
41 if !cobrautil.IsCobraManagedCommand(os.Args) {
42 confUI.PrintLinef("Succeeded")
43 }
44 return nil
45}

Callers 1

mainFunction · 0.85

Calls 1

NewDefaultKctrlCmdFunction · 0.92

Tested by

no test coverage detected