-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gen.go
45 lines (41 loc) · 853 Bytes
/
gen.go
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
package main
import (
"os"
"github.com/urfave/cli/v2"
"lure.sh/lure/pkg/gen"
)
var genCmd = &cli.Command{
Name: "generate",
Usage: "Generate a LURE script from a template",
Aliases: []string{"gen"},
Subcommands: []*cli.Command{
genPipCmd,
},
}
var genPipCmd = &cli.Command{
Name: "pip",
Usage: "Generate a LURE script for a pip module",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "name",
Aliases: []string{"n"},
Required: true,
},
&cli.StringFlag{
Name: "version",
Aliases: []string{"v"},
Required: true,
},
&cli.StringFlag{
Name: "description",
Aliases: []string{"d"},
},
},
Action: func(c *cli.Context) error {
return gen.Pip(os.Stdout, gen.PipOptions{
Name: c.String("name"),
Version: c.String("version"),
Description: c.String("description"),
})
},
}