2016-05-30 16:08:09 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/kataras/cli"
|
|
|
|
"github.com/kataras/iris"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2016-10-23 06:20:39 +02:00
|
|
|
// Name the name of the cmd tool
|
2016-12-12 11:18:59 +01:00
|
|
|
Name = "Iris Command Line Tool"
|
|
|
|
app *cli.App
|
2016-05-30 16:08:09 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2016-06-20 10:59:36 +02:00
|
|
|
// init the cli app
|
2016-10-23 06:20:39 +02:00
|
|
|
app = cli.NewApp("iris", "Command line tool for Iris web framework", iris.Version)
|
2016-06-20 10:59:36 +02:00
|
|
|
// version command
|
2016-10-23 06:20:39 +02:00
|
|
|
app.Command(cli.Command("version", "\t prints your iris version").
|
|
|
|
Action(func(cli.Flags) error { app.Printf("%s", app.Version); return nil }))
|
2016-06-20 10:59:36 +02:00
|
|
|
// run command/-/run.go
|
2016-06-03 15:09:25 +02:00
|
|
|
|
2016-06-20 10:59:36 +02:00
|
|
|
// register the commands
|
2016-10-23 06:20:39 +02:00
|
|
|
app.Command(buildGetCommand())
|
|
|
|
app.Command(buildRunCommand())
|
2016-06-03 15:09:25 +02:00
|
|
|
|
2016-05-30 16:08:09 +02:00
|
|
|
}
|
|
|
|
|
2016-06-20 10:59:36 +02:00
|
|
|
func main() {
|
|
|
|
// run the application
|
2016-10-23 06:20:39 +02:00
|
|
|
app.Run(func(cli.Flags) error {
|
2016-06-20 10:59:36 +02:00
|
|
|
return nil
|
|
|
|
})
|
2016-05-30 16:08:09 +02:00
|
|
|
}
|