woodpecker/cli/main.go

46 lines
745 B
Go
Raw Normal View History

2014-07-16 07:34:23 +00:00
package main
import (
"github.com/codegangsta/cli"
"os"
)
2014-08-09 23:51:08 +00:00
var (
// commit sha for the current build.
version string = "0.3-dev"
revision string
)
2014-07-16 07:34:23 +00:00
func main() {
app := cli.NewApp()
app.Name = "drone"
2014-08-09 23:51:08 +00:00
app.Version = version
2014-07-16 07:34:23 +00:00
app.Usage = "command line utility"
2014-08-09 23:51:08 +00:00
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "t, token",
Value: "",
Usage: "server auth token",
EnvVar: "DRONE_TOKEN",
},
cli.StringFlag{
Name: "s, server",
Value: "",
Usage: "server location",
EnvVar: "DRONE_SERVER",
},
}
2014-07-16 07:34:23 +00:00
app.Commands = []cli.Command{
2014-08-08 05:22:04 +00:00
NewBuildCommand(),
NewReposCommand(),
NewStatusCommand(),
2014-07-16 07:34:23 +00:00
NewEnableCommand(),
NewDisableCommand(),
NewRestartCommand(),
NewWhoamiCommand(),
}
app.Run(os.Args)
}