Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ArgInfo ¶ added in v0.21.0
type ArgInfo struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Optional bool `json:"optional,omitempty"`
// Repeat marks an argument that may be given more than once. Only the last
// argument of a command can repeat.
Repeat bool `json:"repeat,omitempty"`
}
ArgInfo describes a single positional argument of a command, in the order it is expected on the command line.
type CommandInfo ¶ added in v0.21.0
type CommandInfo struct {
// FullPath is the command as typed, e.g. "cache clear".
FullPath string `json:"full_path"`
Description string `json:"description"`
// Dynamic marks a node whose name is resolved at runtime (a cluster name,
// a cache key, ...). Its FullPath carries a "<placeholder>" instead of a
// literal name - run the command to discover the actual values.
Dynamic bool `json:"dynamic,omitempty"`
Arguments []ArgInfo `json:"arguments,omitempty"`
Flags []FlagInfo `json:"flags,omitempty"`
Subcommands []CommandInfo `json:"subcommands,omitempty"`
}
CommandInfo describes one command for the `posh agent catalog` catalog. It mirrors the shape used by other agent-facing CLIs, so a consumer that can read one catalog can read this one.
func (CommandInfo) Usage ¶ added in v0.21.0
func (c CommandInfo) Usage() string
Usage renders the arguments as a usage string, e.g. "[Key] <Value>...", where required arguments are bracketed, optional ones angled and a repeatable argument is suffixed with "...".
type FlagInfo ¶ added in v0.21.0
type FlagInfo struct {
Name string `json:"name"`
Shorthand string `json:"shorthand,omitempty"`
Type string `json:"type"`
Default string `json:"default"`
Description string `json:"description"`
}
FlagInfo describes a single flag of a command.
Click to show internal directories.
Click to hide internal directories.