Fixed aliases

This commit is contained in:
alessio 2016-07-27 11:14:32 +02:00
parent fa3f693572
commit c82f0d9f14

33
main.go
View File

@ -13,7 +13,6 @@ const(
email = "pracchia@hastega.it" email = "pracchia@hastega.it"
description = "Run and build your applications on file changes. Watch custom paths and specific extensions. Define additional commands and multiple projects" description = "Run and build your applications on file changes. Watch custom paths and specific extensions. Define additional commands and multiple projects"
author = "Alessio Pracchia" author = "Alessio Pracchia"
) )
func main() { func main() {
@ -39,8 +38,8 @@ func main() {
{ {
Name: "run", Name: "run",
Usage: "Build and watch file changes", Usage: "Build and watch file changes",
Action: func(c *cli.Context) error { Action: func(p *cli.Context) error {
fmt.Printf("Hello %q", c.String("run")) fmt.Printf("Hello %q", p.String("run"))
return nil return nil
}, },
}, },
@ -55,15 +54,15 @@ func main() {
&cli.BoolFlag{Name: "build", Aliases: []string{"b"}, Value: true}, &cli.BoolFlag{Name: "build", Aliases: []string{"b"}, Value: true},
&cli.BoolFlag{Name: "run", Aliases: []string{"r"}, Value: true}, &cli.BoolFlag{Name: "run", Aliases: []string{"r"}, Value: true},
}, },
Action: func(params *cli.Context) error { Action: func(p *cli.Context) error {
y := realize.New(params) y := realize.New(p)
return handle(y.Create(params)) return handle(y.Create(p))
}, },
}, },
{ {
Name: "add", Name: "add",
Category: "config", Category: "config",
Aliases: []string{"s"}, Aliases: []string{"a"},
Usage: "Add another project", Usage: "Add another project",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{Name: "name", Aliases: []string{"n"}, Value: "Sample App"}, &cli.StringFlag{Name: "name", Aliases: []string{"n"}, Value: "Sample App"},
@ -71,31 +70,31 @@ func main() {
&cli.BoolFlag{Name: "build", Aliases: []string{"b"}, Value: true}, &cli.BoolFlag{Name: "build", Aliases: []string{"b"}, Value: true},
&cli.BoolFlag{Name: "run", Aliases: []string{"r"}, Value: true}, &cli.BoolFlag{Name: "run", Aliases: []string{"r"}, Value: true},
}, },
Action: func(params *cli.Context) error { Action: func(p *cli.Context) error {
y := realize.New(params) y := realize.New(p)
return handle(y.Add(params)) return handle(y.Add(p))
}, },
}, },
{ {
Name: "remove", Name: "remove",
Category: "config", Category: "config",
Aliases: []string{"s"}, Aliases: []string{"r"},
Usage: "Remove a project", Usage: "Remove a project",
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{Name: "name", Aliases: []string{"n"}, Value: "Sample App"}, &cli.StringFlag{Name: "name", Aliases: []string{"n"}, Value: "Sample App"},
}, },
Action: func(params *cli.Context) error { Action: func(p *cli.Context) error {
y := realize.New(params) y := realize.New(p)
return handle(y.Remove(params)) return handle(y.Remove(p))
}, },
}, },
{ {
Name: "list", Name: "list",
Category: "config", Category: "config",
Aliases: []string{"s"}, Aliases: []string{"l"},
Usage: "Projects list", Usage: "Projects list",
Action: func(params *cli.Context) error { Action: func(p *cli.Context) error {
y := realize.New(params) y := realize.New(p)
return handle(y.List()) return handle(y.List())
}, },
}, },