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 ``` 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, "|", `\|`), + ) } } }