Skip to content

Commit 494ec70

Browse files
committed
fix: add specific error messages for missing test command arguments
Signed-off-by: namanyadav-08 <namanyadav8125@gmail.com>
1 parent 0d608c9 commit 494ec70

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cmd/test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ func NewTestCommand(globalClientOpts *connectors.ClientOptions) *cobra.Command {
5858

5959
// Validate presence and values of args.
6060
if len(serviceRef) == 0 || strings.HasPrefix(serviceRef, "-") {
61-
fmt.Println("test command require <apiName:apiVersion> <testEndpoint> <runner> args")
61+
fmt.Fprintln(os.Stderr, "missing required argument: <apiName:apiVersion> (e.g. 'my-api:1.0')")
6262
os.Exit(1)
6363
}
6464
if len(testEndpoint) == 0 || strings.HasPrefix(testEndpoint, "-") {
65-
fmt.Println("test command require <apiName:apiVersion> <testEndpoint> <runner> args")
65+
fmt.Fprintln(os.Stderr, "missing required argument: <testEndpoint> (e.g. 'http://localhost:8080/api')")
6666
os.Exit(1)
6767
}
6868
if len(runnerType) == 0 || strings.HasPrefix(runnerType, "-") {
69-
fmt.Println("test command require <apiName:apiVersion> <testEndpoint> <runner> args")
69+
fmt.Fprintln(os.Stderr, "missing required argument: <runner> (e.g. 'HTTP', 'POSTMAN', 'OPEN_API_SCHEMA')")
7070
os.Exit(1)
7171
}
7272
if _, validChoice := runnerChoices[runnerType]; !validChoice {

0 commit comments

Comments
 (0)