Execute executes the root command.
()
| 232 | |
| 233 | // Execute executes the root command. |
| 234 | func Execute() { |
| 235 | defer func() { |
| 236 | r := recover() |
| 237 | if r != nil { |
| 238 | WriteStderr("[panic] %v\n", r) |
| 239 | debug.PrintStack() |
| 240 | wshutil.DoShutdown("", 1, true) |
| 241 | } else { |
| 242 | wshutil.DoShutdown("", WshExitCode, false) |
| 243 | } |
| 244 | }() |
| 245 | rootCmd.PersistentFlags().StringVarP(&blockArg, "block", "b", "", "for commands which require a block id") |
| 246 | err := rootCmd.Execute() |
| 247 | if err != nil { |
| 248 | wshutil.DoShutdown("", 1, true) |
| 249 | return |
| 250 | } |
| 251 | } |
no test coverage detected