本文整理汇总了Golang中github.com/keybase/cli.Command.Flags方法的典型用法代码示例。如果您正苦于以下问题:Golang Command.Flags方法的具体用法?Golang Command.Flags怎么用?Golang Command.Flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/cli.Command
的用法示例。
在下文中一共展示了Command.Flags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewCmdSignup
func NewCmdSignup(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
cmd := cli.Command{
Name: "signup",
Usage: "Signup for a new account",
Action: func(c *cli.Context) {
cl.ChooseCommand(NewCmdSignupRunner(g), "signup", c)
},
Flags: []cli.Flag{
cli.StringFlag{
Name: "c, invite-code",
Usage: "Specify an invite code.",
},
cli.StringFlag{
Name: "email",
Usage: "Specify an account email.",
},
cli.StringFlag{
Name: "username",
Usage: "Specify a username.",
},
},
}
cmd.Flags = append(cmd.Flags, extraSignupFlags...)
return cmd
}
示例2: NewCmdLogin
func NewCmdLogin(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
cmd := cli.Command{
Name: "login",
ArgumentHelp: "[username]",
Usage: "Establish a session with the keybase server",
Action: func(c *cli.Context) {
cl.ChooseCommand(NewCmdLoginRunner(g), "login", c)
},
Flags: []cli.Flag{
cli.BoolFlag{
Name: "provision-by-email",
Usage: "Use an email address associated with a keybase account to provision a device",
},
},
}
// Note we'll only be able to set this via mode via Environment variable
// since it's too early to check command-line setting of it.
if g.Env.GetRunMode() == libkb.DevelRunMode {
cmd.Flags = append(cmd.Flags, cli.BoolFlag{
Name: "emulate-gui",
Usage: "emulate GUI signing and fork GPG from the service",
})
}
return cmd
}
示例3: NewCmdProve
// NewCmdProve makes a new prove command from the given CLI parameters.
func NewCmdProve(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
serviceList := strings.Join(libkb.ListProofCheckers(), ", ")
description := fmt.Sprintf("Supported services are: %s.", serviceList)
cmd := cli.Command{
Name: "prove",
ArgumentHelp: "<service> [service username]",
Usage: "Generate a new proof",
Description: description,
Flags: []cli.Flag{
cli.StringFlag{
Name: "output, o",
Usage: "Output proof text to a file (rather than standard out).",
},
cli.BoolFlag{
Name: "force, f",
Usage: "Don't prompt.",
},
},
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdProve{Contextified: libkb.NewContextified(g)}, "prove", c)
},
}
cmd.Flags = append(cmd.Flags, restrictedProveFlags...)
return cmd
}
示例4: cmdIDAddFlags
func cmdIDAddFlags(cmd *cli.Command) {
cmd.Flags = append(cmd.Flags, cli.BoolFlag{
Name: "delegate-identify-ui",
Usage: "Delegate our identify UI to another process",
})
}