Skip to content
Browse files

Wrap command execution with global error check

This wraps the base command execute function call with an error check
so that all sub-commands that return an error will result in the main
executable returning a non-zero exit code. This is especially useful in
automated scripts for knowing if the k3sup command has failed.
The error messages are already handled elsewhere, this is only to set
and error exit code.

Signed-off-by: Burton Rheutan <>
  • Loading branch information
burtonr authored and alexellis committed Jan 12, 2020
1 parent 8af48ea commit 9eaee3df6b959403b082f920bf11765c30420272
Showing with 5 additions and 1 deletion.
  1. +5 −1 main.go
@@ -1,6 +1,8 @@
package main

import (

@@ -28,5 +30,7 @@ func main() {

if err := rootCmd.Execute(); err != nil {

0 comments on commit 9eaee3d

Please sign in to comment.
You can’t perform that action at this time.