MCPcopy Create free account
hub / github.com/docker/cli / main

Function main

cmd/docker-trust/main.go:67–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67func main() {
68 cmd, err := command.NewDockerCli()
69 if err != nil {
70 _, _ = fmt.Fprintln(os.Stderr, err)
71 os.Exit(1)
72 }
73
74 if err = run(cmd); err == nil {
75 return
76 }
77
78 if errors.As(err, &errCtxSignalTerminated{}) {
79 os.Exit(getExitCode(err))
80 }
81
82 if !cerrdefs.IsCanceled(err) {
83 if err.Error() != "" {
84 _, _ = fmt.Fprintln(cmd.Err(), err)
85 }
86 os.Exit(getExitCode(err))
87 }
88}
89
90// getExitCode returns the exit-code to use for the given error.
91// If err is a [cli.StatusError] and has a StatusCode set, it uses the

Callers

nothing calls this directly

Calls 4

ErrMethod · 0.95
runFunction · 0.70
getExitCodeFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…