Log error and exit with code if invalid command. Closes #60

pull/61/head
Miguel Mota 4 years ago
parent 19b3fc6193
commit c16fc03120

1
.gitignore vendored

@ -43,6 +43,7 @@ bin
main main
!main.go !main.go
wasm wasm
.config
# flatpak # flatpak
.flatpak-builder .flatpak-builder

@ -1,5 +1,10 @@
package cmd package cmd
import (
"fmt"
"os"
)
// Execute executes the program // Execute executes the program
func Execute() { func Execute() {
rootCmd := RootCmd() rootCmd := RootCmd()
@ -15,6 +20,7 @@ func Execute() {
) )
if err := rootCmd.Execute(); err != nil { if err := rootCmd.Execute(); err != nil {
panic(err) fmt.Println(err)
os.Exit(1)
} }
} }

Loading…
Cancel
Save