moved cmd to cli folder

This commit is contained in:
Brad Rydzewski
2014-09-24 21:24:12 -07:00
parent 7fed5f5de6
commit 46b3d9daae
12 changed files with 3 additions and 3 deletions

30
cli/enable.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/codegangsta/cli"
"github.com/drone/drone/client"
)
// NewEnableCommand returns the CLI command for "enable".
func NewEnableCommand() cli.Command {
return cli.Command{
Name: "enable",
Usage: "enable a repository",
Flags: []cli.Flag{},
Action: func(c *cli.Context) {
handle(c, enableCommandFunc)
},
}
}
// enableCommandFunc executes the "enable" command.
func enableCommandFunc(c *cli.Context, client *client.Client) error {
var host, owner, name string
var args = c.Args()
if len(args) != 0 {
host, owner, name = parseRepo(args[0])
}
return client.Repos.Enable(host, owner, name)
}