commands

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mid

func Mid(value int, min, max int) int

Mid is a tiny-tiny helper to return int value constrained by `min <= value <= max`.

func NewKeybinding

func NewKeybinding(strokes []string, helpKeys, helpDesc string) key.Binding

NewKeybinding is a simple constructor that creates a key.Binding from provided strokes and help input.

func ScreenDimensions

func ScreenDimensions() (int, int)

ScreenDimensions returns the terminal width and height, constrained to `80 <= x <= 120`

func StrLenValidator

func StrLenValidator(fieldLabel string, min, max int) func(string) error

StrLenValidator returns a func that ensures a string's len is within range.

Types

type CliCommand

type CliCommand interface {
	// Action satisfies
	Action(ctx *cli.Context) error
}

CliCommand exports an Action func that can be run in the tui.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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