create command
This commit is contained in:
parent
b3858f3b3e
commit
733c12b81c
74
main.go
74
main.go
@ -4,45 +4,45 @@ import (
|
|||||||
//"os"
|
//"os"
|
||||||
//"gopkg.in/urfave/cli.v2"
|
//"gopkg.in/urfave/cli.v2"
|
||||||
"github.com/tockins/realize/realize"
|
"github.com/tockins/realize/realize"
|
||||||
|
"gopkg.in/urfave/cli.v2"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type person struct {
|
|
||||||
name string
|
|
||||||
age int
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
t := realize.Init()
|
app := &cli.App{
|
||||||
t.Create()
|
Name: "realize",
|
||||||
|
Version: "1.0",
|
||||||
//app := &cli.App{
|
Usage: "A sort of Webpack for Go. Run, build and watch file changes with custom paths",
|
||||||
// Name: "realize",
|
Commands: []*cli.Command{
|
||||||
// Version: "1.0",
|
{
|
||||||
// Usage: "A sort of Webpack for Go. Run, build and watch file changes with custom paths",
|
Name: "run",
|
||||||
// Commands: []*cli.Command{
|
Usage: "Build and watch file changes",
|
||||||
// {
|
Action: func(c *cli.Context) error {
|
||||||
// Name: "run",
|
fmt.Printf("Hello %q", c.String("run"))
|
||||||
// Usage: "Build and watch file changes",
|
return nil
|
||||||
// Action: func(c *cli.Context) error {
|
},
|
||||||
// fmt.Printf("Hello %q", c.String("run"))
|
},
|
||||||
// return nil
|
{
|
||||||
// },
|
Name: "start",
|
||||||
// },
|
Category: "config",
|
||||||
// {
|
Usage: "create the initial config file",
|
||||||
// Name: "start",
|
Action: func(c *cli.Context) error {
|
||||||
// Category: "config",
|
realize.Init().Create()
|
||||||
// Usage: "create the initial config file",
|
fmt.Printf("Hello %q", c.String("run"))
|
||||||
// },
|
return nil
|
||||||
// },
|
},
|
||||||
// Flags: []cli.Flag {
|
},
|
||||||
// &cli.StringFlag{
|
},
|
||||||
// Name: "run",
|
Flags: []cli.Flag {
|
||||||
// Value: "main.go",
|
&cli.StringFlag{
|
||||||
// Usage: "main file of your project",
|
Name: "run",
|
||||||
// },
|
Value: "main.go",
|
||||||
// },
|
Usage: "main file of your project",
|
||||||
//}
|
},
|
||||||
//
|
},
|
||||||
//app.Run(os.Args)
|
}
|
||||||
|
|
||||||
|
app.Run(os.Args)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user