Documentation
¶
Index ¶
- func NewRootCmd(client *client.Client) *cobra.Command
- type BoolFlagOpts
- type Command
- func BuildCommand(parent *Command, fn RunFn, usageText string, shortHelpText string, ...) *Command
- func BuildCommandCobra(parent *Command, fn RunFn, cmd *cobra.Command, client *client.Client, ...) *Command
- func BuildCommandKS(parent *Command, fn RunFn, keystrings docstrings.KeyStrings, ...) *Command
- type Initializer
- type InitializerFn
- type IntFlagOpts
- type Option
- type PeerStatusJson
- type RunFn
- type StartPeerJson
- type StringFlagOpts
- type StringSliceFlagOpts
- type UpdatePeerJson
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootCmd ¶ added in v0.0.189
BUG(tqbf): this code is called by root.New() in internal/command/root/root.go; we're apparently halfway through a migration out of flyctl/cmd/ and into internal/command/, which I support, but this is obviously pretty confusing. I lost 8 minutes to figuring this out so you don't have to.
Types ¶
type BoolFlagOpts ¶
type BoolFlagOpts struct {
Name string
Shorthand string
Description string
Default bool
EnvName string
Hidden bool
}
BoolFlagOpts - options for boolean flags
type Command ¶
Command - Wrapper for a cobra command
func BuildCommand ¶
func BuildCommand(parent *Command, fn RunFn, usageText string, shortHelpText string, longHelpText string, client *client.Client, options ...Option) *Command
BuildCommand - builds a functioning Command using all the initializers
func BuildCommandCobra ¶ added in v0.0.236
func BuildCommandKS ¶ added in v0.0.138
func BuildCommandKS(parent *Command, fn RunFn, keystrings docstrings.KeyStrings, client *client.Client, options ...Option) *Command
BuildCommandKS - A wrapper for BuildCommand which takes the docs.KeyStrings bundle instead of the coder having to manually unwrap it
func (*Command) AddBoolFlag ¶
func (c *Command) AddBoolFlag(options BoolFlagOpts)
AddBoolFlag - Add a boolean flag for a command
func (*Command) AddCommand ¶
AddCommand adds subcommands to this command
func (*Command) AddIntFlag ¶ added in v0.0.121
func (c *Command) AddIntFlag(options IntFlagOpts)
AddIntFlag - Add an integer flag to a command
func (*Command) AddStringFlag ¶
func (c *Command) AddStringFlag(options StringFlagOpts)
AddStringFlag - Add a string flag to a command
func (*Command) AddStringSliceFlag ¶ added in v0.0.84
func (c *Command) AddStringSliceFlag(options StringSliceFlagOpts)
AddStringSliceFlag - add a string slice flag to a command
type Initializer ¶
type Initializer struct {
Setup InitializerFn
PreRun InitializerFn
}
Initializer - Retains Setup and PreRun functions
type InitializerFn ¶
type InitializerFn func(*cmdctx.CmdContext) error
InitializerFn - A wrapper for an Initializer function that takes a command context
type IntFlagOpts ¶ added in v0.0.121
type IntFlagOpts struct {
Name string
Shorthand string
Description string
Default int
EnvName string
Hidden bool
}
IntFlagOpts - options for integer flags
type Option ¶ added in v0.0.135
type Option func(*Command) Initializer
Option - A wrapper for an Initializer function that takes a command
type PeerStatusJson ¶ added in v0.0.179
type RunFn ¶ added in v0.0.135
type RunFn func(cmdContext *cmdctx.CmdContext) error
RunFn - Run function for commands which takes a command context
type StartPeerJson ¶ added in v0.0.179
type StringFlagOpts ¶
type StringFlagOpts struct {
Name string
Shorthand string
Description string
Default string
EnvName string
Hidden bool
}
StringFlagOpts - options for string flags
type StringSliceFlagOpts ¶ added in v0.0.84
type StringSliceFlagOpts struct {
Name string
Shorthand string
Description string
Default []string
EnvName string
}
StringSliceFlagOpts - options a string slice flag
type UpdatePeerJson ¶ added in v0.0.179
type UpdatePeerJson struct {
Pubkey string `json:"pubkey"`
}
Notes ¶
Bugs ¶
this code is called by root.New() in internal/command/root/root.go; we're apparently halfway through a migration out of flyctl/cmd/ and into internal/command/, which I support, but this is obviously pretty confusing. I lost 8 minutes to figuring this out so you don't have to.
can't stay this way