Skip to content

Commit 648c256

Browse files
committed
feat: cmd/oas2meta: add main.go
1 parent c613ac3 commit 648c256

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cmd/oas2meta/main.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log/slog"
6+
"os"
7+
8+
"github.com/grokify/mogo/fmt/fmtutil"
9+
"github.com/grokify/spectrum/openapi2"
10+
)
11+
12+
func main() {
13+
if len(os.Args) < 2 {
14+
slog.Error("usage: oas2meta ...<filepath>")
15+
os.Exit(1)
16+
} else if set, err := openapi2.NewSpecMetaSetFilepaths(os.Args[1:]); err != nil {
17+
slog.Error(err.Error())
18+
os.Exit(2)
19+
} else {
20+
fmtutil.MustPrintJSON(set)
21+
fmt.Println("DONE")
22+
os.Exit(0)
23+
}
24+
}

0 commit comments

Comments
 (0)