Help us shape the future of Go! Take the 2026 Go Developer Survey

helpview

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ViewName = "help"

Variables

View Source
var SupportContact string

SupportContact, when non-empty, is rendered as a SUPPORT line at the bottom of the keybinding cheat-sheet. Empty by default so OSS shows nothing; editions set it to their support address at startup.

Functions

This section is empty.

Types

type CommandHelp

type CommandHelp struct {
	Title    string
	Detail   string // optional prose rendered under the USAGE section
	Sections []HelpCategory
}

CommandHelp is the payload for the per-command `--help` / `:help <cmd>` screen. It is a distinct type (not []HelpCategory) so the view factory routes it to the vertical layout and the keybinding cheat-sheet path is left untouched.

type CommandInfo

type CommandInfo struct {
	Name        string
	Description string
	Aliases     []string
}

type HelpCategory

type HelpCategory struct {
	Title string
	Items []HelpItem
}

func FromKeys

func FromKeys(title string, viewKeys, globalKeys []helpbar.HelpEntry) []HelpCategory

FromKeys builds a help screen for a view that does not carry one of its own.

It is deliberately derived rather than written: ShortHelpItems is part of the View contract, so every view — including one added tomorrow — has something to say here, and it is the same list the operator can already see in the help bar. A view with more to explain than its keys implements HelpContent instead; this is the floor, not the ceiling.

type HelpItem

type HelpItem struct {
	Keys        string
	Description string
}

type Model

type Model struct {
	Viewable viewport.Model
	Visible  bool
	// contains filtered or unexported fields
}

func New

func New(width, height int, cmds []CommandInfo) *Model

func NewCommandHelp

func NewCommandHelp(width, height int, ch CommandHelp) *Model

NewCommandHelp builds the model for the per-command help screen.

func NewDetailed

func NewDetailed(width, height int, categories []HelpCategory) *Model

func (*Model) ApplySearchQuery

func (m *Model) ApplySearchQuery(query string)

ApplySearchQuery implements view.Filterable — filters commands/keybindings.

func (*Model) ClearSearchQuery

func (m *Model) ClearSearchQuery()

ClearSearchQuery implements view.Filterable — clears the filter.

func (*Model) FrameContent

func (m *Model) FrameContent() string

func (*Model) FrameFooter

func (m *Model) FrameFooter() string

func (*Model) FrameHeader

func (m *Model) FrameHeader() string

func (*Model) FrameTitle

func (m *Model) FrameTitle() string

func (*Model) HasErrors

func (m *Model) HasErrors() bool

func (*Model) Init

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

func (*Model) Name

func (m *Model) Name() string

func (*Model) OnEnter

func (m *Model) OnEnter() tea.Cmd

func (*Model) OnExit

func (m *Model) OnExit() tea.Cmd

func (*Model) ShortHelpItems

func (m *Model) ShortHelpItems() []helpbar.HelpEntry

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

Jump to

Keyboard shortcuts

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