Skip to content

Commit

Permalink
提交新的版本 v0.2 版本(修复bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
LJTian committed Sep 14, 2024
1 parent 81b2d81 commit bc9e481
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Info
json to yaml tool
json to yaml tool.

# Install
```shell
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion pkg/help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bc9e481

Please sign in to comment.