From d52a4d3f4d9443c24f7408ca3b980ed9229c4894 Mon Sep 17 00:00:00 2001 From: James Cooper Date: Fri, 20 May 2022 05:18:09 -0700 Subject: [PATCH] Fix version subcommand. Do not print usage if run subcommand fails. (#475) * Fix version subcommand. Do not print usage if run subcommand fails. * Remove newline to clean up PR diff --- cmd/godog/internal/cmd_run.go | 3 ++- cmd/godog/internal/cmd_version.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/godog/internal/cmd_run.go b/cmd/godog/internal/cmd_run.go index 52fde46..8813765 100644 --- a/cmd/godog/internal/cmd_run.go +++ b/cmd/godog/internal/cmd_run.go @@ -32,7 +32,8 @@ buildable go source.`, feature (*.feature) scenario at specific line (*.feature:10) If no feature arguments are supplied, godog will use "features/" by default.`, - RunE: runCmdRunFunc, + RunE: runCmdRunFunc, + SilenceUsage: true, } flags.BindRunCmdFlags("", runCmd.Flags(), &opts) diff --git a/cmd/godog/internal/cmd_version.go b/cmd/godog/internal/cmd_version.go index e0423f3..78fb8bc 100644 --- a/cmd/godog/internal/cmd_version.go +++ b/cmd/godog/internal/cmd_version.go @@ -14,6 +14,7 @@ func CreateVersionCmd() cobra.Command { versionCmd := cobra.Command{ Use: "version", Short: "Show current version", + Run: versionCmdRunFunc, Version: godog.Version, }