Skip to content

Commit

Permalink
Exit code should be non-0 when a command is not found (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 authored Aug 4, 2023
1 parent 9d2d0ed commit bf03b22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/util/commandNotFound.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package util

import (
"fmt"
"os"

"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit bf03b22

Please sign in to comment.