Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCommand ¶
func RegisterCommand(command Command)
RegisterCommand adds a new Command type to the list of available commands in the CLI.
Types ¶
type Command ¶
type Command interface { // Command returns the cobra.Command type so that the CLI can be built. Command() *cobra.Command // Init implements the bubbletea.Model.Init() interface. Init() tea.Cmd // Type returns a unique type string identifying the command. Type() CommandType // Update implements the bubbletea.Model.Update() interface. Update(msg tea.Msg) (tea.Model, tea.Cmd) // View implements the bubbletea.Model.View() interface. View() string }
Command is an interface that implements the bubbletea.Model interface, as well as returning a cobra.Command type, so that they can play well together.
func RegisteredCommands ¶
func RegisteredCommands() []Command
RegisteredCommands returns all registered Command types in the CLI.
type CommandType ¶
type CommandType string
CommandType is the unique ID for a Command.
const ( CommandTypeCompletion CommandType = "completion" CommandTypeVersion CommandType = "version" )
type Completion ¶
type Completion struct {
// contains filtered or unexported fields
}
Completion is a CLI command that generates shell completion scripts for different types of environments.
func (Completion) Command ¶
func (c Completion) Command() *cobra.Command
func (Completion) Init ¶
func (c Completion) Init() tea.Cmd
func (Completion) Type ¶
func (c Completion) Type() CommandType
func (Completion) View ¶
func (c Completion) View() string
Click to show internal directories.
Click to hide internal directories.