0
0
Fork 0
mirror of https://gitea.plemya-x.ru/Plemya-x/ALR.git synced 2025-01-10 17:26:45 +00:00
ALR/gen.go

46 lines
854 B
Go
Raw Normal View History

2024-01-22 10:36:06 +00:00
package main
import (
"os"
"github.com/urfave/cli/v2"
2024-05-05 10:32:08 +00:00
"plemya-x.ru/alr/pkg/gen"
2024-01-22 10:36:06 +00:00
)
var genCmd = &cli.Command{
Name: "generate",
2024-05-05 10:32:08 +00:00
Usage: "Generate a ALR script from a template",
2024-01-22 10:36:06 +00:00
Aliases: []string{"gen"},
Subcommands: []*cli.Command{
genPipCmd,
},
}
var genPipCmd = &cli.Command{
Name: "pip",
2024-05-05 10:32:08 +00:00
Usage: "Generate a ALR script for a pip module",
2024-01-22 10:36:06 +00:00
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"),
})
},
}