Documentation
¶
Overview ¶
Package clide is a package utilized in the automated CLI demo tool clide. This package contains functions for managing and manipulating clide commands, windows, and clide-defined structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenForKey ¶
func ListenForKey(cfg Config)
ListenForKey blocks execution until a key is pressed. Use in a goroutine to watch in the background
Types ¶
type Colors ¶ added in v1.1.0
type Colors struct { UserText string `json:"userText"` DirectoryText string `json:"directoryText"` PrimaryText string `json:"primaryText"` TerminalBG string `json:"terminalBG"` }
Colors holds information for the color scheme of the terminal window and text
type Command ¶
type Command struct { CmdString string `json:"cmd"` Typed bool `json:"typed"` Window string `json:"window"` PreDelay int `json:"predelay"` PostDelay int `json:"postdelay"` Timeout int `json:"timeout"` Hidden bool `json:"hidden"` WaitForKey bool `json:"waitForKey"` ClearBeforeRun bool `json:"clearBeforeRun"` Async bool `json:"async"` HideWindow bool `json:"hideWindow"` ResizeWindows []Window `json:"resizeWindows"` }
Command holds a single clide command
func (Command) IsInstalled ¶
IsInstalled checks to see if the command is installed on the system
type Config ¶
type Config struct { User string `json:"user"` Directory string `json:"directory"` TypeSpeed int `json:"typeSpeed"` Humanize float64 `json:"humanize"` HideWarnings bool `json:"hideWarnings"` ClearBeforeAll bool `json:"clearBeforeAll"` KeyTriggerAll bool `json:"keyTriggerAll"` HideWindows bool `json:"hideWindows"` FontPath string `json:"fontPath"` FontSize int `json:"fontSize"` Windows []Window `json:"windows"` TiggerKeys []string `json:"triggerKeys"` ColorScheme Colors `json:"colorScheme"` Commands []Command `json:"commands"` TyperList []*Typer }
Config holds the global configuration for a clide demo
func NewDefaultConfig ¶ added in v1.3.0
NewDefaultConfig returns a config struct initialized to default values useful for writing to a clide window if no config exists
func (Config) BuildTyperList ¶ added in v1.3.0
BuildTyperList creates a window for each window defined in config, and then attaches a typer to each window that is created
func (Config) ClearAllWindows ¶ added in v1.3.0
ClearAllWindows clears all existing windows by referencing all Window objects linked to Typer in cfg.TyperList
func (Config) GetWindow ¶ added in v1.3.0
GetWindow return the window object with the specified name
type Typer ¶
type Typer struct { Window *sdl.Window Pos Position Font Font Speed int Humanize float64 // contains filtered or unexported fields }
Typer holds all information neeeded to type or print text to a window
func (*Typer) ClearWindow ¶ added in v1.3.0
ClearWindow removes all content on the window specified in typer