Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlternativeSource ¶
type ArgumentItem ¶
type ArgumentItem struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Variadic bool `json:"variadic,omitempty" yaml:"variadic,omitempty"`
MinItems int `json:"minItems,omitempty" yaml:"minItems,omitempty"`
MaxItems int `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Default any `json:"default,omitempty" yaml:"default,omitempty"`
Hidden bool `json:"hidden,omitempty" yaml:"hidden,omitempty"`
Choices []Choice `json:"choices,omitempty" yaml:"choices,omitempty"`
Passthrough bool `json:"passthrough,omitempty" yaml:"passthrough,omitempty"`
}
type CommandItem ¶
type CommandItem struct {
Segment string // the single command segment, e.g.: petstore pets add --> `add`
Derived bool // Command was derived from internal segments when unmarshalling a spec-compliant OpenCLI doc and not explicitly declared
CommandLineRaw string // the literal command line string defined in the spec-compliant document
CommandLine string // the parsed command line without {commands}, <arguments>, [flags], etc.
Summary string
Description string
Aliases []string
Args []ArgumentItem
Flags []FlagItem
Hidden bool
Kind CommandKind
ExitCodes []ExitCode
Examples []Example
Commands []*CommandItem
// Properties set during post processing of unmarshalling
VisibleArgs bool
VisibleFlags bool
VisibleChildren bool
VisibleChildrenArgs bool
VisibleChildrenFlags bool
VisiblePassthroughArgs bool
CommandModifiers []string
ArgsModifiers []string
PassthroughArgsModifiers []string
FlagsModifiers []string
}
type CommandKind ¶
type CommandKind string
var ( CommandKindGroup CommandKind = "group" CommandKindAction CommandKind = "action" )
type Configuration ¶
type Document ¶
type Document struct {
OpenCLIVersion string
Info Info
Install []InstallMethod
Global *Global
Commands *CommandItem
}
Document represents the top-level OpenCLI document.
type FlagItem ¶
type FlagItem struct {
Name string `json:"name" yaml:"name"`
Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"`
Type string `json:"type" yaml:"type"`
Variadic bool `json:"variadic" yaml:"variadic,omitempty"`
MinItems int `json:"minItems,omitempty" yaml:"minItems,omitempty"`
MaxItems int `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Default any `json:"default,omitempty" yaml:"default,omitempty"`
Hidden bool `json:"hidden,omitempty" yaml:"hidden,omitempty"`
Choices []Choice `json:"choices,omitempty" yaml:"choices,omitempty"`
AltSources []AlternativeSource `json:"alternativeSources,omitempty" yaml:"alternativeSources,omitempty"`
}
type Global ¶
type Global struct {
ExitCodes []ExitCode `json:"exitCodes,omitempty" yaml:"exitCodes,omitempty"`
Config Configuration `json:"config" yaml:"config"`
Flags []FlagItem `json:"flags,omitempty" yaml:"flags,omitempty"`
}
type Info ¶
type Info struct {
Title string `json:"title" yaml:"title"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
License *License `json:"license,omitempty" yaml:"license,omitempty"`
Contact *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
Binary string `json:"binary" yaml:"binary"`
Version string `json:"version" yaml:"version"`
}
type InstallMethod ¶
Click to show internal directories.
Click to hide internal directories.