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