shellcmd

package module
v0.0.0-...-6fce075 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddItemToSelect

func AddItemToSelect(item selectItem)

func ApplyLogOut

func ApplyLogOut(log LogOutput)

func ClearSelectItems

func ClearSelectItems()

func CreateCnCmd

func CreateCnCmd(shell *ishell.Shell)

func CreateDebugLevelCmd

func CreateDebugLevelCmd(shell *ishell.Shell)

func CreateDefaultComands

func CreateDefaultComands(shell *ishell.Shell)

CreateDefaultComands simple comands they just used as command. - lint - version

func CreateMenuCommands

func CreateMenuCommands(shell *ishell.Shell)

func CreateRunCommands

func CreateRunCommands(shell *ishell.Shell) bool

CreateRunCommands to display any run target. without an targetname, we will display a pick list

func CreateWsCmd

func CreateWsCmd(shell *ishell.Shell)

CreateWsCmd command to switch the workspaces

func RunIShell

func RunIShell()

func TextInput

func TextInput(label string, placeHolder string, limit int, width int) (string, error)

func WaitForResponse

func WaitForResponse()

Types

type CmdMenuItem

type CmdMenuItem struct {
	Name        string
	Running     bool
	Selected    bool
	RunCount    int
	UpdateCount int
	Blocked     bool
	HaveError   bool
}

func (CmdMenuItem) Description

func (i CmdMenuItem) Description() string

func (CmdMenuItem) FilterValue

func (i CmdMenuItem) FilterValue() string

func (CmdMenuItem) Title

func (i CmdMenuItem) Title() string

model functions for the runMenu

type LogOutput

type LogOutput struct {
	// contains filtered or unexported fields
}
var (
	UiLogger LogOutput = *NewAutoSizeLogOutput()
)

func NewAutoSizeLogOutput

func NewAutoSizeLogOutput() *LogOutput

func NewLogOutput

func NewLogOutput(max int, maxWidth int) *LogOutput

func (*LogOutput) Add

func (l *LogOutput) Add(s string)

Add adds a string to the buffer if the string contains a newline, it will be split and added as multiple lines if the buffer is full, the oldest line will be removed if the string is empty, nothing will be added if the string is a newline, nothing will be added

func (*LogOutput) Clear

func (l *LogOutput) Clear()

func (*LogOutput) GetBuffer

func (l *LogOutput) GetBuffer() []string

func (*LogOutput) GetMax

func (l *LogOutput) GetMax() int

func (*LogOutput) GetSize

func (l *LogOutput) GetSize() int

func (*LogOutput) Init

func (l *LogOutput) Init() tea.Cmd

func (*LogOutput) SetMax

func (l *LogOutput) SetMax(max int)

func (*LogOutput) SetSize

func (l *LogOutput) SetSize(maxWidth, maxRowsShown int)

func (*LogOutput) Update

func (l *LogOutput) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*LogOutput) View

func (l *LogOutput) View() string

type RunMenuDelegate

type RunMenuDelegate struct{}

create oure own delegate to render the menu items

func (RunMenuDelegate) Height

func (d RunMenuDelegate) Height() int

func (RunMenuDelegate) Render

func (d RunMenuDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (RunMenuDelegate) Spacing

func (d RunMenuDelegate) Spacing() int

func (RunMenuDelegate) Update

func (d RunMenuDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

type RundCmd

type RundCmd struct {
	// contains filtered or unexported fields
}

func NewRunMenu

func NewRunMenu(targets []string, log LogOutput) RundCmd

func (RundCmd) GetSelectedIndex

func (m RundCmd) GetSelectedIndex() int

func (RundCmd) Init

func (m RundCmd) Init() tea.Cmd

func (RundCmd) Run

func (m RundCmd) Run() (tea.Model, error)

func (RundCmd) Update

func (m RundCmd) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (RundCmd) View

func (m RundCmd) View() string

type TextInputModel

type TextInputModel struct {
	Label string

	Value string
	// contains filtered or unexported fields
}

func InitTextInput

func InitTextInput(placeHolder string, limit int, width int) TextInputModel

func (*TextInputModel) GetValue

func (m *TextInputModel) GetValue() string

func (*TextInputModel) Init

func (m *TextInputModel) Init() tea.Cmd

func (*TextInputModel) Update

func (m *TextInputModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*TextInputModel) View

func (m *TextInputModel) View() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL