本文整理汇总了Golang中github.com/convox/cli/stdcli.RegisterCommand函数的典型用法代码示例。如果您正苦于以下问题:Golang RegisterCommand函数的具体用法?Golang RegisterCommand怎么用?Golang RegisterCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RegisterCommand函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: init
func init() {
rand.Seed(time.Now().UTC().UnixNano())
stdcli.RegisterCommand(cli.Command{
Name: "install",
Description: "install convox into an aws account",
Usage: "",
Action: cmdInstall,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "dedicated",
Usage: "create EC2 instances on dedicated hardware",
},
},
})
stdcli.RegisterCommand(cli.Command{
Name: "uninstall",
Description: "uninstall convox from an aws account",
Usage: "",
Action: cmdUninstall,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force",
Usage: "uninstall even if apps exist",
},
},
})
}
示例2: init
func init() {
rand.Seed(time.Now().UTC().UnixNano())
stdcli.RegisterCommand(cli.Command{
Name: "install",
Description: "install convox into an aws account",
Usage: "",
Action: cmdInstall,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "dedicated",
Usage: "create EC2 instances on dedicated hardware",
},
cli.IntFlag{
Name: "instance-count",
Value: 3,
Usage: "number of EC2 instances",
},
cli.StringFlag{
Name: "instance-type",
Value: "t2.small",
Usage: "type of EC2 instances",
},
cli.StringFlag{
Name: "region",
Value: "us-east-1",
Usage: "aws region to install in",
EnvVar: "AWS_REGION",
},
},
})
stdcli.RegisterCommand(cli.Command{
Name: "uninstall",
Description: "uninstall convox from an aws account",
Usage: "",
Action: cmdUninstall,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force",
Usage: "uninstall even if apps exist",
},
cli.StringFlag{
Name: "region",
Value: "us-east-1",
Usage: "aws region to uninstall from",
EnvVar: "AWS_REGION",
},
},
})
}
示例3: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "builds",
Description: "manage an app's builds",
Usage: "",
Action: cmdBuilds,
Flags: []cli.Flag{appFlag},
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new build",
Usage: "",
Action: cmdBuild,
Flags: []cli.Flag{appFlag},
},
{
Name: "info",
Description: "print output for a build",
Usage: "<ID>",
Action: cmdBuildsInfo,
Flags: []cli.Flag{appFlag},
},
},
})
}
示例4: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "env",
Description: "manage an app's environment variables",
Usage: "get|set|unset",
Action: cmdEnvGetAll,
Flags: []cli.Flag{appFlag},
Subcommands: []cli.Command{
{
Name: "get",
Usage: "VARIABLE",
Action: cmdEnvGet,
Flags: []cli.Flag{appFlag},
},
{
Name: "set",
Usage: "VARIABLE=VALUE",
Action: cmdEnvSet,
Flags: []cli.Flag{appFlag},
},
{
Name: "unset",
Usage: "VARIABLE",
Action: cmdEnvUnset,
Flags: []cli.Flag{appFlag},
},
},
})
}
示例5: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "system",
Description: "manage your Convox rack",
Usage: "",
Action: cmdSystem,
Subcommands: []cli.Command{
{
Name: "update",
Description: "update rack to the latest version",
Usage: "[version]",
Action: cmdSystemUpdate,
},
{
Name: "scale",
Description: "scale the rack capacity",
Usage: "",
Action: cmdSystemScale,
Flags: []cli.Flag{
cli.IntFlag{
Name: "count",
Usage: "horizontally scale the instance count, e.g. 3 or 10",
},
cli.StringFlag{
Name: "type",
Usage: "vertically scale the instance type, e.g. t2.small or c3.xlargs",
},
},
},
},
})
}
示例6: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "services",
Description: "manage services",
Usage: "",
Action: cmdServices,
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new service",
Usage: "<name> <postgres|redis>",
Action: cmdServiceCreate,
},
{
Name: "delete",
Description: "delete a service",
Usage: "<name>",
Action: cmdServiceDelete,
},
{
Name: "info",
Description: "info about a service",
Usage: "<name>",
Action: cmdServiceInfo,
},
},
})
}
示例7: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "apps",
Action: cmdApps,
Description: "list deployed apps",
Flags: []cli.Flag{
cli.StringFlag{
Name: "app",
Usage: "app name. If not specified, use current directory.",
},
},
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new application",
Usage: "[name]",
Action: cmdAppCreate,
},
{
Name: "delete",
Description: "delete an application",
Usage: "<name>",
Action: cmdAppDelete,
},
},
})
}
示例8: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "system",
Description: "manage the base convox system",
Usage: "",
Action: cmdSystem,
Subcommands: []cli.Command{
{
Name: "update",
Description: "update the convox system API",
Usage: "<version>",
Action: cmdSystemUpate,
},
{
Name: "scale",
Description: "scale the convox system cluster",
Usage: "",
Action: cmdSystemScale,
Flags: []cli.Flag{
cli.IntFlag{
Name: "count",
Usage: "instance count, e.g. 3 or 10",
},
cli.StringFlag{
Name: "type",
Usage: "instance type, e.g. t2.small or c3.xlargs",
},
},
},
},
})
}
示例9: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "apps",
Action: cmdApps,
Description: "list deployed apps",
Subcommands: []cli.Command{
{
Name: "create",
Description: "create a new application",
Usage: "[name]",
Action: cmdAppCreate,
},
{
Name: "delete",
Description: "delete an application",
Usage: "[name]",
Action: cmdAppDelete,
},
{
Name: "info",
Description: "see info about an app",
Usage: "[name]",
Action: cmdAppInfo,
},
},
})
}
示例10: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "releases",
Description: "list an app's releases",
Usage: "",
Action: cmdReleases,
Flags: []cli.Flag{
cli.StringFlag{
Name: "app",
Usage: "App name. Inferred from current directory if not specified.",
},
},
Subcommands: []cli.Command{
{
Name: "promote",
Description: "promote a release",
Usage: "<release id>",
Action: cmdReleasePromote,
Flags: []cli.Flag{
cli.StringFlag{
Name: "app",
Usage: "app name. Inferred from current directory if not specified.",
},
},
},
},
})
}
示例11: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "switch",
Description: "switch to another convox rack",
Usage: "host",
Action: cmdSwitch,
})
}
示例12: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "update",
Description: "update the cli",
Usage: "",
Action: cmdUpdate,
})
}
示例13: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "top",
Action: cmdTop,
Description: "resource utilization stats",
Usage: "",
})
}
示例14: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "start",
Description: "start an app for local development",
Usage: "<directory>",
Action: cmdStart,
})
}
示例15: init
func init() {
stdcli.RegisterCommand(cli.Command{
Name: "info",
Description: "see info about an app",
Usage: "[--app name]",
Action: cmdInfo,
Flags: []cli.Flag{
cli.StringFlag{
Name: "app",
Usage: "app name. Inferred from current directory if not specified.",
},
},
})
}