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