Skip to content

Commit 5076793

Browse files
committed
migrated from package cli to flag for yaml2json
1 parent 5f1aec3 commit 5076793

File tree

3 files changed

+47
-20
lines changed

3 files changed

+47
-20
lines changed

cmd/csv2json/csv2json.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,15 @@ func main() {
184184
fmt.Fprintln(eout, err)
185185
os.Exit(1)
186186
}
187+
defer in.Close()
187188
}
188189
if outputFName != "" {
189190
out, err = os.Create(outputFName)
190191
if err != nil {
191192
fmt.Fprintln(eout, err)
192193
os.Exit(1)
193194
}
195+
defer out.Close()
194196
}
195197

196198
// Process options

codemeta2cff.1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pubDate: 2022-10-28
88

99
codemeta2cff
1010

11-
# SYSNOPSIS
11+
# SYNOPSIS
1212

1313
codemeta2cff [OPTIONS] [CODEMETA_JSON CITATION_CFF]
1414

yaml2json.1.md

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,57 @@
1+
---
2+
title: "{app_name} (1) user manual"
3+
author: "R. S. Doiel"
4+
pubDate: 2023-01-09
5+
---
16

2-
USAGE: yaml2json [OPTIONS] [YAML_FILENAME] [JSON_NAME]
7+
# NAME
38

4-
DESCRIPTION
9+
{app_name}
510

6-
yaml2json is a tool that converts YAML into JSON output.
11+
# SYNOPSIS
712

8-
OPTIONS
13+
{app_name} [OPTIONS] [YAML_FILENAME] [JSON_NAME]
914

10-
-examples display example(s)
11-
-generate-manpage generate man page
12-
-generate-markdown generate markdown documentation
13-
-h, -help display help
14-
-l, -license display license
15-
-nl, -newline if true add a trailing newline
16-
-o, -output output filename
17-
-p, -pretty pretty print output
18-
-quiet suppress error messages
19-
-v, -version display version
15+
# DESCRIPTION
2016

17+
{app_name} is a tool that converts YAML into JSON output.
2118

22-
EXAMPLES
19+
# OPTIONS
20+
21+
22+
-help:
23+
display help
24+
25+
-license
26+
: display license
27+
28+
-version
29+
: display version
30+
31+
-nl, -newline
32+
: if true add a trailing newline
33+
34+
-o, -output
35+
: output filename
36+
37+
-p, -pretty
38+
: pretty print output
39+
40+
-quiet
41+
: suppress error messages
42+
43+
44+
# EXAMPLES
2345

2446
These would get the file named "my.yaml" and save it as my.json
2547

26-
yaml2json my.yaml > my.json
48+
~~~
49+
{app_name} my.yaml > my.json
50+
51+
{app_name} my.yaml my.json
2752
28-
yaml2json my.yaml my.json
53+
cat my.yaml | {app_name} -i - > my.json
54+
~~~
2955

30-
cat my.yaml | yaml2json -i - > my.json
56+
{app_name} {version}
3157

32-
yaml2json 1.2.1

0 commit comments

Comments
 (0)