From 5c8fd02130bb7f36b0e92e2e9d0110650360b8e8 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 2 Dec 2025 09:36:52 +0100 Subject: [PATCH 1/2] Fix pipe escaping in curl2steps --- cmd/curl2steps/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/curl2steps/main.go b/cmd/curl2steps/main.go index b7a2286..be0926e 100644 --- a/cmd/curl2steps/main.go +++ b/cmd/curl2steps/main.go @@ -95,7 +95,10 @@ func printTable(t map[string][]string) { v := t[k] for _, vv := range v { - fmt.Printf(" | %s | %s |\n", k, vv) + fmt.Printf(" | %s | %s |\n", + strings.ReplaceAll(k, "|", `\|`), + strings.ReplaceAll(vv, "|", `\|`), + ) } } } From e67c498800320c9af03c29f6ebde92b1a6130a66 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Tue, 2 Dec 2025 09:40:02 +0100 Subject: [PATCH 2/2] Update README --- README.md | 2 ++ cmd/curl2steps/README.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index d654a1e..4b69a5b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Client does not attempt to limit concurrency of multiple `godog` scenarios, it i the service is capable to process multiple scenarios simultaneously, or scenarios are [synchronized explicitly](https://github.com/godogx/resource#steps). +If you have a `curl` command with relevant request, you can convert it to steps with [`curl2steps`](./cmd/curl2steps). + #### Request Setup ```gherkin diff --git a/cmd/curl2steps/README.md b/cmd/curl2steps/README.md index ab579df..bcb6ad1 100644 --- a/cmd/curl2steps/README.md +++ b/cmd/curl2steps/README.md @@ -2,6 +2,12 @@ This tool converts `curl` command to steps. +## Install + +``` +go install github.com/godogx/httpsteps/cmd/curl2steps@latest +``` + ## Examples ```