-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
50 lines (46 loc) · 1.16 KB
/
main.go
File metadata and controls
50 lines (46 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"context"
"os"
runner "github.com/b3nten/ssss/runner"
"github.com/fatih/color"
"github.com/urfave/cli/v3"
)
func main() {
cmd := &cli.Command{
Name: "stupidly-simple-serialization-system",
Description: "ssss is a simple binary de/serialization library which generates single file, zero dependency artifacts.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "input",
Usage: "path to input schema file",
Required: true,
Aliases: []string{"i", "file", "in"},
},
&cli.StringFlag{
Name: "output",
Usage: "directory for generated code output",
Required: true,
Aliases: []string{"o", "out"},
},
&cli.StringFlag{
Name: "lang",
Usage: "target programming language or path to custom templater file",
Required: true,
Aliases: []string{"l", "generator"},
},
&cli.BoolFlag{
Name: "debug",
Usage: "enable debug output",
Aliases: []string{"d"},
},
},
Action: runner.Run,
}
if err := cmd.Run(context.Background(), os.Args); err != nil {
red := color.New(color.FgRed)
boldRed := red.Add(color.Bold)
boldRed.Println(err.Error())
os.Exit(1)
}
}