Documentation
¶
Overview ¶
Package commands defines the CLI command structure for the yapi application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommand ¶ added in v0.5.0
func BuildCommand(spec CommandSpec) *cobra.Command
BuildCommand creates a cobra command from a spec.
Types ¶
type CommandSpec ¶ added in v0.5.0
type CommandSpec struct {
Use string
Aliases []string
Short string
Long string
Args cobra.PositionalArgs
Handler func(*cobra.Command, []string) error
Flags []FlagSpec
}
CommandSpec defines the specification for a command.
type Config ¶
type Config struct {
URLOverride string
NoColor bool
BinaryOutput bool
Insecure bool
Environment string // Target environment from project config
}
Config holds configuration for command execution
type FlagSpec ¶ added in v0.5.0
type FlagSpec struct {
Name string
Shorthand string
Type string // "bool", "string", etc.
Default interface{}
Usage string
}
FlagSpec defines a command flag.
type Handlers ¶
type Handlers struct {
RunInteractive func(cmd *cobra.Command, args []string) error
Run func(cmd *cobra.Command, args []string) error
Watch func(cmd *cobra.Command, args []string) error
History func(cmd *cobra.Command, args []string) error
LSP func(cmd *cobra.Command, args []string) error
Version func(cmd *cobra.Command, args []string) error
Validate func(cmd *cobra.Command, args []string) error
Test func(cmd *cobra.Command, args []string) error
List func(cmd *cobra.Command, args []string) error
Stress func(cmd *cobra.Command, args []string) error
About func(cmd *cobra.Command, args []string) error
Import func(cmd *cobra.Command, args []string) error
}
Handlers contains the callback functions for command execution
Click to show internal directories.
Click to hide internal directories.