1
0
mirror of https://github.com/drone/drone-cli.git synced 2025-07-15 08:44:18 +02:00
drone-cli/drone/disable.go
2015-02-13 00:23:01 -08:00

31 lines
656 B
Go

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