Skip to content

Commit

Permalink
fix:keploy CLI logs error message when command is unknown (#1879)
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <yash2010118@akgec.ac.in>
  • Loading branch information
khareyash05 committed May 31, 2024
1 parent 008821b commit 3077a9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"fmt"
"os"
"strings"
"syscall"

"go.keploy.io/server/v2/cli"
Expand Down Expand Up @@ -87,6 +88,10 @@ func start(ctx context.Context) {
cmdConfigurator := provider.NewCmdConfigurator(logger, conf)
rootCmd := cli.Root(ctx, logger, svcProvider, cmdConfigurator)
if err := rootCmd.Execute(); err != nil {
os.Exit(1)
if strings.HasPrefix(err.Error(), "unknown command") || strings.HasPrefix(err.Error(), "unknown shorthand") {
fmt.Println("Error: ", err.Error())
fmt.Println("Run 'keploy --help' for usage.")
os.Exit(1)
}
}
}

0 comments on commit 3077a9c

Please sign in to comment.