Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunctionName ¶ added in v0.9.3
func GetFunctionName(i interface{}) string
func OnInterrupt ¶ added in v0.9.3
func OnInterrupt(fn func())
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 { ProjectName string Commands map[string]*Command[T] Splitter splitter.Splitter ArgSplitter splitter.Splitter CaseInsensitive bool Prompter func(*ShellCli[T]) string Data *T // contains filtered or unexported fields }
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.