You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2023/08/04 06:19:11 UTC

[skywalking-cli] branch master updated: Exit code should be non-0 when a command is not found (#192)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-cli.git


The following commit(s) were added to refs/heads/master by this push:
     new bf03b22  Exit code should be non-0 when a command is not found (#192)
bf03b22 is described below

commit bf03b226c5ad9d86b7e98489bde6ff7d3d82b3ab
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Fri Aug 4 14:19:05 2023 +0800

    Exit code should be non-0 when a command is not found (#192)
---
 pkg/util/commandNotFound.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkg/util/commandNotFound.go b/pkg/util/commandNotFound.go
index a0a2b0a..be462bb 100644
--- a/pkg/util/commandNotFound.go
+++ b/pkg/util/commandNotFound.go
@@ -19,6 +19,7 @@ package util
 
 import (
 	"fmt"
+	"os"
 
 	"github.com/urfave/cli/v2"
 )
@@ -55,6 +56,7 @@ func CommandNotFound(c *cli.Context, s string) {
 	} else {
 		fmt.Printf("Run 'swctl %s --help' for usage.\n", parentCommand)
 	}
+	os.Exit(1)
 }
 
 // minEditDistance calculates the edit distance of two strings.