Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command[T any] struct { Description string Args [][3]string // Map of argument to the description and default value Run func(a *ShellCli[T], args map[string]string) error }
Command is a command for the shell client
type ShellCli ¶
type ShellCli[T any] struct { Commands map[string]*Command[T] Splitter splitter.Splitter ArgSplitter splitter.Splitter CaseInsensitive bool Prompter func(*ShellCli[T]) string Data *T }
ShellCli is a simple shell-like interface with commands
func (*ShellCli[T]) AddCommand ¶
AddCommand adds a command to the shell client
It is recommended to use this to add a command over directly modifying the Commands map as this function will be updated to be backwards compatible with future changes
Click to show internal directories.
Click to hide internal directories.