1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-01-23 17:53:23 +02:00
woodpecker/cli/main.go

49 lines
778 B
Go
Raw Normal View History

2014-07-16 00:34:23 -07:00
package main
import (
"os"
2015-02-04 14:42:24 +01:00
"github.com/codegangsta/cli"
2014-07-16 00:34:23 -07:00
)
2014-08-09 16:51:08 -07:00
var (
// commit sha for the current build.
2015-01-12 16:51:54 +03:00
version string
2014-08-09 16:51:08 -07:00
revision string
)
2014-07-16 00:34:23 -07:00
func main() {
app := cli.NewApp()
app.Name = "drone"
2014-08-09 16:51:08 -07:00
app.Version = version
2014-07-16 00:34:23 -07:00
app.Usage = "command line utility"
2014-08-09 16:51:08 -07: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 00:34:23 -07:00
app.Commands = []cli.Command{
2014-08-07 22:22:04 -07:00
NewBuildCommand(),
NewReposCommand(),
NewStatusCommand(),
2014-07-16 00:34:23 -07:00
NewEnableCommand(),
NewDisableCommand(),
NewRestartCommand(),
NewWhoamiCommand(),
NewSetKeyCommand(),
2015-02-04 14:42:24 +01:00
NewDeleteCommand(),
2014-07-16 00:34:23 -07:00
}
app.Run(os.Args)
}