Skip to content

Commit bf03b22

Browse files
authored
Exit code should be non-0 when a command is not found (#192)
1 parent 9d2d0ed commit bf03b22

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/util/commandNotFound.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package util
1919

2020
import (
2121
"fmt"
22+
"os"
2223

2324
"github.com/urfave/cli/v2"
2425
)
@@ -55,6 +56,7 @@ func CommandNotFound(c *cli.Context, s string) {
5556
} else {
5657
fmt.Printf("Run 'swctl %s --help' for usage.\n", parentCommand)
5758
}
59+
os.Exit(1)
5860
}
5961

6062
// minEditDistance calculates the edit distance of two strings.

0 commit comments

Comments
 (0)