diff --git a/CHANGELOG.md b/CHANGELOG.md index 695d27c0..7fd8100e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,15 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt ## Unreleased ### Changed -- README example is updated with `context.Context` and `go test` usage. ([477](https://github.com/cucumber/godog/pull/477) - [vearutop](https://github.com/vearutop)) +- README example is updated with `context.Context` and `go test` usage. ([477](https://github.com/cucumber/godog/pull/477) - [vearutop](https://github.com/vearutop)) ### Fixed - Fixed a bug which would ignore the context returned from a substep.([488](https://github.com/cucumber/godog/pull/488) - [wichert](https://github.com/wichert)) - Fixed a bug which would cause a panic when using the pretty formatter with a feature that contained a rule. ([480](https://github.com/cucumber/godog/pull/480) - [dumpsterfireproject](https://github.com/dumpsterfireproject)) +### Deprecated +- `godog` CLI tool prints deprecation warning. ([489](https://github.com/cucumber/godog/pull/489) - [vearutop](https://github.com/vearutop)) + ## [v0.12.5] ### Changed - Changed underlying cobra command setup to return errors instead of calling `os.Exit` directly to enable simpler testing. ([454](https://github.com/cucumber/godog/pull/454) - [mxygem](https://github.com/mxygem)) diff --git a/cmd/godog/internal/cmd_build.go b/cmd/godog/internal/cmd_build.go index 3175666d..7ea4c021 100644 --- a/cmd/godog/internal/cmd_build.go +++ b/cmd/godog/internal/cmd_build.go @@ -5,7 +5,9 @@ import ( "go/build" "path/filepath" + "github.com/cucumber/godog/colors" "github.com/cucumber/godog/internal/builder" + "github.com/spf13/cobra" ) @@ -37,6 +39,9 @@ The test runner can be executed with the same flags as when using godog run.`, } func buildCmdRunFunc(cmd *cobra.Command, args []string) error { + fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead.")) + fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details.")) + bin, err := filepath.Abs(buildOutput) if err != nil { return fmt.Errorf("could not locate absolute path for: %q. reason: %v", buildOutput, err) diff --git a/cmd/godog/internal/cmd_root.go b/cmd/godog/internal/cmd_root.go index c25c6564..f028435f 100644 --- a/cmd/godog/internal/cmd_root.go +++ b/cmd/godog/internal/cmd_root.go @@ -44,7 +44,8 @@ func runRootCmd(cmd *cobra.Command, args []string) error { } } - fmt.Println(colors.Yellow("Use of godog without a sub-command is deprecated. Please use godog build, godog run or godog version.")) + fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead.")) + fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details.")) return runCmdRunFunc(cmd, args) } diff --git a/cmd/godog/internal/cmd_run.go b/cmd/godog/internal/cmd_run.go index 88137651..afa2291e 100644 --- a/cmd/godog/internal/cmd_run.go +++ b/cmd/godog/internal/cmd_run.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/cobra" + "github.com/cucumber/godog/colors" "github.com/cucumber/godog/internal/builder" "github.com/cucumber/godog/internal/flags" ) @@ -42,6 +43,9 @@ buildable go source.`, } func runCmdRunFunc(cmd *cobra.Command, args []string) error { + fmt.Println(colors.Yellow("Use of godog CLI is deprecated, please use *testing.T instead.")) + fmt.Println(colors.Yellow("See https://github.com/cucumber/godog/discussions/478 for details.")) + osArgs := os.Args[1:] if len(osArgs) > 0 && osArgs[0] == "run" {