• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang autocomplete.CmdFlagsAutoComplete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/Scalingo/cli/cmd/autocomplete.CmdFlagsAutoComplete函数的典型用法代码示例。如果您正苦于以下问题:Golang CmdFlagsAutoComplete函数的具体用法?Golang CmdFlagsAutoComplete怎么用?Golang CmdFlagsAutoComplete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CmdFlagsAutoComplete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1:

package cmd

import (
	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/apps"
	"github.com/Scalingo/cli/cmd/autocomplete"
)

var (
	AppsCommand = cli.Command{
		Name:        "apps",
		Category:    "Global",
		Description: "List your apps and give some details about them",
		Usage:       "List your apps",
		Action: func(c *cli.Context) {
			if err := apps.List(); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "apps")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:24,代码来源:apps.go


示例2:

		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
			if len(c.Args()) == 0 {
				err = domains.List(currentApp)
			} else {
				cli.ShowCommandHelp(c, "domains")
			}

			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "domains")
		},
	}

	DomainsAddCommand = cli.Command{
		Name:     "domains-add",
		Category: "Custom Domains",
		Usage:    "Add a custom domain to an application",
		Flags: []cli.Flag{appFlag,
			cli.StringFlag{Name: "cert", Usage: "SSL Signed Certificate", Value: "domain.crt", EnvVar: ""},
			cli.StringFlag{Name: "key", Usage: "SSL Keypair", Value: "domain.key", EnvVar: ""},
		},
		Description: `Add a custom domain to an application:

    $ scalingo -a myapp domains-add example.com
开发者ID:Zyko0,项目名称:cli,代码行数:29,代码来源:domains.go


示例3:

	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/codegangsta-cli"
)

var (
	RestartCommand = cli.Command{
		Name:     "restart",
		Category: "App Management",
		Usage:    "Restart processes of your app",
		Flags:    []cli.Flag{appFlag, cli.BoolFlag{Name: "synchronous, s", Usage: "Do the restart synchronously", EnvVar: ""}},
		Description: `Restart one or several process or your application:
	Example
	  ## Restart all the processes
	  scalingo --app my-app restart
		## Restart all the web processes
	  scalingo --app my-app restart web
		## Restart a specific container
	  scalingo --app my-app restart web-1`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if err := apps.Restart(currentApp, c.Bool("s"), c.Args()); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "restart")
			autocomplete.RestartAutoComplete(c)
		},
	}
)
开发者ID:carriercomm,项目名称:cli-8,代码行数:30,代码来源:restart.go


示例4:

package cmd

import (
	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/cmd/autocomplete"
)

var (
	HelpCommand = cli.Command{
		Name:  "help",
		Usage: "Shows a list of commands or help for one command",
		Action: func(c *cli.Context) {
			args := c.Args()
			if args.Present() {
				cli.ShowCommandHelp(c, args.First())
			} else {
				cli.ShowAppHelp(c)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "help")
			autocomplete.HelpAutoComplete(c)
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:25,代码来源:help.go


示例5:

	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/appdetect"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/cli/db"
)

var (
	MySQLConsoleCommand = cli.Command{
		Name:     "mysql-console",
		Category: "Databases",
		Usage:    "Run an interactive console with your MySQL addon",
		Flags:    []cli.Flag{appFlag},
		Description: ` Run an interactive console with your MySQL addon.
    $ scalingo -a myapp mysql-console

    # See also 'mongo-console' and 'pgsql-console'
`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 0 {
				cli.ShowCommandHelp(c, "redis-console")
			} else if err := db.MySQLConsole(currentApp); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "mysql-console")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:30,代码来源:mysql.go


示例6:

`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
			if len(c.Args()) == 0 {
				err = notifications.List(currentApp)
			} else {
				cli.ShowCommandHelp(c, "notifications")
			}

			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "notifications")
		},
	}
	NotificationsAddCommand = cli.Command{
		Name:     "notifications-add",
		Category: "Notifications",
		Flags:    []cli.Flag{appFlag},
		Usage:    "Enable a notification for your application",
		Description: ` Enable a notification for your application:
    $ scalingo -a myapp notifications-add <webhook-url>

		# See also 'notifications' and 'notifications-remove'
`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
开发者ID:carriercomm,项目名称:cli-8,代码行数:31,代码来源:notifications.go


示例7:

   Example
     scalingo run -e VARIABLE=VALUE -e VARIABLE2=OTHER_VALUE rails console

   Furthermore, you may want to upload a file, like a database dump or anything
   useful to you. The option '-f' has been built for this purpose, you can even
   upload multiple files if you wish. You will be able to find these files in the
   '/tmp/uploads' directory of the one-off container.

   Example
     scalingo run -f mysqldump.sql rails dbconsole < /tmp/uploads/mysqldump.sql`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			opts := apps.RunOpts{
				App:    currentApp,
				Cmd:    c.Args(),
				CmdEnv: c.StringSlice("e"),
				Files:  c.StringSlice("f"),
			}
			if len(c.Args()) == 0 {
				cli.ShowCommandHelp(c, "run")
			} else if err := apps.Run(opts); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "run")
		},
	}
)
开发者ID:yannski,项目名称:cli,代码行数:29,代码来源:run.go


示例8:

		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
			if len(c.Args()) == 0 {
				err = env.Display(currentApp)
			} else {
				cli.ShowCommandHelp(c, "env")
			}

			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "env")
		},
	}

	EnvSetCommand = cli.Command{
		Name:     "env-set",
		Category: "Environment",
		Flags:    []cli.Flag{appFlag},
		Usage:    "Set the environment variables of your apps",
		Description: `Set variables:

    $ scalingo -a myapp env-set VAR1=VAL1 VAR2=VAL2

    # See also commands 'env' and 'env-unset'`,

		Action: func(c *cli.Context) {
开发者ID:Zyko0,项目名称:cli,代码行数:30,代码来源:env.go


示例9:

		Usage:       "List the collaborators of an application",
		Flags:       []cli.Flag{appFlag},
		Description: "List all the collaborator of an application and display information about them.",
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 0 {
				cli.ShowCommandHelp(c, "collaborators")
			} else {
				err := collaborators.List(currentApp)
				if err != nil {
					errorQuit(err)
				}
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "collaborators")
		},
	}

	CollaboratorsAddCommand = cli.Command{
		Name:        "collaborators-add",
		Category:    "Collaborators",
		Usage:       "Invite someone to work on an application",
		Flags:       []cli.Flag{appFlag},
		Description: "Invite someone to collaborate on an application, an invitation will be sent to the given email\n scalingo -a myapp collaborators-add [email protected]",
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 1 {
				cli.ShowCommandHelp(c, "collaborators-add")
			} else {
				err := collaborators.Add(currentApp, c.Args()[0])
开发者ID:Zyko0,项目名称:cli,代码行数:31,代码来源:collaborators.go


示例10:

	"github.com/Scalingo/cli/appdetect"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/cli/db"
	"github.com/Scalingo/codegangsta-cli"
)

var (
	RedisConsoleCommand = cli.Command{
		Name:     "redis-console",
		Category: "Databases",
		Usage:    "Run an interactive console with your redis addon",
		Flags:    []cli.Flag{appFlag},
		Description: ` Run an interactive console with your redis addon.
    $ scalingo -a myapp redis-console

    # See also 'mongo-console' and 'mysql-console'
`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 0 {
				cli.ShowCommandHelp(c, "redis-console")
			} else if err := db.RedisConsole(currentApp); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "redis-console")
		},
	}
)
开发者ID:carriercomm,项目名称:cli-8,代码行数:30,代码来源:redis.go


示例11:

package cmd

import (
	"github.com/Scalingo/cli/addon_providers"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/codegangsta-cli"
)

var (
	AddonProvidersListCommand = cli.Command{
		Name:        "addons-list",
		Category:    "Addons - Global",
		Description: "List all addons you can add to your app.",
		Usage:       "List all addons",
		Action: func(c *cli.Context) {
			if err := addon_providers.List(); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "addons-list")
		},
	}
)
开发者ID:carriercomm,项目名称:cli-8,代码行数:24,代码来源:addon_providers_list.go


示例12:

	"github.com/Scalingo/cli/appdetect"
	"github.com/Scalingo/cli/apps"
	"github.com/Scalingo/cli/cmd/autocomplete"
)

var (
	ScaleCommand = cli.Command{
		Name:     "scale",
		Category: "App Management",
		Flags:    []cli.Flag{appFlag, cli.BoolFlag{Name: "synchronous", Usage: "Do the scaling synchronously", EnvVar: ""}},
		Usage:    "Scale your application instantly",
		Description: `Scale your application processes.
   Example
     'scalingo --app my-app scale web:2 worker:1'
     'scalingo --app my-app scale web:1 worker:0'
     'scalingo --app my-app scale web:1:XL'`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) == 0 {
				cli.ShowCommandHelp(c, "scale")
			} else if err := apps.Scale(currentApp, c.Bool("synchronous"), c.Args()); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "scale")
			autocomplete.ScaleAutoComplete(c)
		},
	}
)
开发者ID:yannski,项目名称:cli,代码行数:30,代码来源:scale.go


示例13:

	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/appdetect"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/cli/db"
)

var (
	MongoConsoleCommand = cli.Command{
		Name:     "mongo-console",
		Category: "Databases",
		Usage:    "Run an interactive console with your MongoDB addon",
		Flags:    []cli.Flag{appFlag},
		Description: ` Run an interactive console with your MongoDB addon.
    $ scalingo -a myapp mongo-console

    # See also 'redis-console' and 'mysql-console'
`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 0 {
				cli.ShowCommandHelp(c, "mongo-console")
			} else if err := db.MongoConsole(currentApp); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "mongo-console")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:30,代码来源:mongo.go


示例14:

import (
	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/apps"
	"github.com/Scalingo/cli/cmd/autocomplete"
)

var (
	CreateCommand = cli.Command{
		Name:        "create",
		ShortName:   "c",
		Category:    "Global",
		Description: "Create a new app:\n   Example:\n     'scalingo create mynewapp'\n     'scalingo create mynewapp --remote \"staging\"'",
		Flags:       []cli.Flag{cli.StringFlag{Name: "remote", Value: "scalingo", Usage: "Remote to add to your current git repository", EnvVar: ""}},
		Usage:       "Create a new app",
		Action: func(c *cli.Context) {
			if len(c.Args()) != 1 {
				cli.ShowCommandHelp(c, "create")
			} else {
				err := apps.Create(c.Args()[0], c.String("remote"))
				if err != nil {
					errorQuit(err)
				}
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "create")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:29,代码来源:create.go


示例15:

		Category: "Public SSH Keys",
		Usage:    "List your SSH public keys",
		Description: `List all the public SSH keys associated with your account:

    $ scalingo keys
		
    # See also commands 'keys-add' and 'keys-remove'`,

		Action: func(c *cli.Context) {
			err := keys.List()
			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "keys")
		},
	}

	AddSSHKeyCommand = cli.Command{
		Name:     "keys-add",
		Category: "Public SSH Keys",
		Usage:    "Add a public SSH key to deploy your apps",
		Description: `Add a public SSH key:

    $ scalingo keys-add keyname /path/to/key

    # See also commands 'keys' and 'keys-remove'`,

		Action: func(c *cli.Context) {
			if len(c.Args()) != 2 {
开发者ID:carriercomm,项目名称:cli-8,代码行数:31,代码来源:keys.go


示例16:

import (
	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/appdetect"
	"github.com/Scalingo/cli/apps"
	"github.com/Scalingo/cli/cmd/autocomplete"
)

var (
	DestroyCommand = cli.Command{
		Name:        "destroy",
		Category:    "Global",
		Flags:       []cli.Flag{appFlag},
		Usage:       "Destroy an app /!\\",
		Description: "Destroy an app /!\\ It is not reversible\n  Example:\n    'scalingo destroy my-app'",
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			if len(c.Args()) != 0 {
				cli.ShowCommandHelp(c, "destroy")
			} else {
				err := apps.Destroy(currentApp)
				if err != nil {
					errorQuit(err)
				}
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "destroy")
		},
	}
)
开发者ID:yannski,项目名称:cli,代码行数:30,代码来源:destroy.go


示例17:

`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
			if len(c.Args()) == 0 {
				err = addons.List(currentApp)
			} else {
				cli.ShowCommandHelp(c, "addons")
			}

			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "addons")
		},
	}
	AddonsAddCommand = cli.Command{
		Name:     "addons-add",
		Category: "Addons",
		Flags:    []cli.Flag{appFlag},
		Usage:    "Provision an add-on for your application",
		Description: ` Provision an add-on for your application:
    $ scalingo -a myapp addons-add <addon-name> <plan>

		# See also 'addons-list' and 'addons-plans'
`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var err error
开发者ID:Zyko0,项目名称:cli,代码行数:31,代码来源:addons.go


示例18:

package cmd

import (
	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/cli/update"
)

var (
	UpdateCommand = cli.Command{
		Name:     "update",
		Category: "CLI Internals",
		Usage:    "Update 'scalingo' client",
		Description: `Update 'scalingo' client
   Example
     'scalingo update'`,
		Action: func(c *cli.Context) {
			err := update.Check()
			if err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "update")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:27,代码来源:update.go


示例19:

package cmd

import (
	"fmt"

	"github.com/Scalingo/cli/Godeps/_workspace/src/github.com/Scalingo/codegangsta-cli"
	"github.com/Scalingo/cli/cmd/autocomplete"
	"github.com/Scalingo/cli/session"
)

var (
	LogoutCommand = cli.Command{
		Name:        "logout",
		Category:    "Global",
		Usage:       "Logout from Scalingo",
		Description: "Destroy login information stored on your computer",
		Action: func(c *cli.Context) {
			if err := session.DestroyToken(); err != nil {
				panic(err)
			}
			fmt.Println("Scalingo credentials have been deleted.")
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "logout")
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:27,代码来源:logout.go


示例20:

     >

   We are looking if an SSH-agent is running on your host, otherwise we are
   using the SSH key '$HOME/.ssh/id_rsa'. You can specify a precise SSH key
   you want to use to authenticate thanks to the '-i' flag.

   Example
     $ scalingo -a rails-app db-tunnel -i ~/.ssh/custom_key DATABASE_URL`,
		Action: func(c *cli.Context) {
			currentApp := appdetect.CurrentApp(c)
			var sshIdentity string
			if c.String("identity") == "" && os.Getenv("SSH_AUTH_SOCK") != "" {
				sshIdentity = "ssh-agent"
			} else if c.String("identity") == "" {
				sshIdentity = sshkeys.DefaultKeyPath
			} else {
				sshIdentity = c.String("identity")
			}
			if len(c.Args()) != 1 {
				cli.ShowCommandHelp(c, "db-tunnel")
			} else if err := db.Tunnel(currentApp, c.Args()[0], sshIdentity, c.Int("port")); err != nil {
				errorQuit(err)
			}
		},
		BashComplete: func(c *cli.Context) {
			autocomplete.CmdFlagsAutoComplete(c, "db-tunnel")
			autocomplete.DbTunnelAutoComplete(c)
		},
	}
)
开发者ID:Zyko0,项目名称:cli,代码行数:30,代码来源:db_tunnel.go



注:本文中的github.com/Scalingo/cli/cmd/autocomplete.CmdFlagsAutoComplete函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang config.ScalingoClient函数代码示例发布时间:2022-05-28
下一篇:
Golang appdetect.CurrentApp函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap