()
| 65 | } |
| 66 | |
| 67 | func 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…