Fix #15: Return error when auth sub-command is missing

This commit is contained in:
abhisek 2023-02-16 16:05:02 +05:30
parent b4c407dddc
commit 504598de65
No known key found for this signature in database
GPG Key ID: CB92A4990C02A88F

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"syscall" "syscall"
@ -22,9 +23,7 @@ func newAuthCommand() *cobra.Command {
Use: "auth", Use: "auth",
Short: "Configure and verify Insights API authentication", Short: "Configure and verify Insights API authentication",
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("You must choose an appropriate command: configure, verify\n") return errors.New("a valid sub-command is required")
os.Exit(1)
return nil
}, },
} }