From bc9e48196e01dbfaa82837593923b8c48c2087ba Mon Sep 17 00:00:00 2001 From: tianlijun Date: Sat, 14 Sep 2024 16:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=B0=E7=9A=84=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20v0.2=20=E7=89=88=E6=9C=AC(=E4=BF=AE=E5=A4=8Dbug)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 +++++++++++------------- pkg/help/help.go | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 54f5db0..f0c8337 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Info -json to yaml tool。 +json to yaml tool. # Install ```shell @@ -11,18 +11,16 @@ make install j2y (json to yaml) is a tool for converting JSON data (from files or direct input) to YAML format. Examples: -[ - 1. Convert from file: - j2y -f input.json -o output.yaml - 2. Convert from command line JSON data: - j2y -i '{"key": "value"}' -o output.yaml - 3. Convert from standard input: - echo '{"foo":1}' | j2y - 4. Specify input file only, output to stdout: - j2y -f input.json - 5. Specify JSON data only, output to stdout: - j2y -i '{"key": "value"}' -] +1.Convert from file: + j2y -f input.json -o output.yaml +2.Convert from command line JSON data: + j2y -i '{"key": "value"}' -o output.yaml +3.Convert from standard input: + echo '{"foo":1}' | j2y +4.Specify input file only, output to stdout: + j2y -f input.json +5.Specify JSON data only, output to stdout: + j2y -i '{"key": "value"}' Usage: Usage: j2y [-f inputFile | -i jsonData] [output] [flags] diff --git a/pkg/help/help.go b/pkg/help/help.go index 0bc3475..6ef68fe 100644 --- a/pkg/help/help.go +++ b/pkg/help/help.go @@ -55,7 +55,7 @@ func generateLongDesc(lang string) string { num := 1 for _, example := range HelpData[lang].Examples { - examples += fmt.Sprintf("%d. %s \n\t %s \n",num, example.Description, example.Command) + examples += fmt.Sprintf("%d.%s \n %s\n",num, example.Description, example.Command) num++ } return fmt.Sprintf("%s\n\nExamples:\n%s", HelpData[lang].ShortDesc,examples)