Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
()
| 73 | // Execute adds all child commands to the root command and sets flags appropriately. |
| 74 | // This is called by main.main(). It only needs to happen once to the rootCmd. |
| 75 | func Execute() { |
| 76 | if err := NewCommand().Execute(); err != nil { |
| 77 | exit := 1 |
| 78 | var terr *exitError |
| 79 | if errors.As(err, &terr) { |
| 80 | exit = terr.Code |
| 81 | } |
| 82 | os.Exit(exit) |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // Command represents an invocation of the Cloud SQL Auth Proxy. |
| 87 | type Command struct { |
no test coverage detected