cli

package
v0.0.0-...-4322911 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Shell = lipgloss.NewStyle().
			MarginLeft(marginLeft).
			Render

	ShellMargin = lipgloss.NewStyle().
				MarginTop(marginTop).
				MarginBottom(marginBottom).
				MarginLeft(marginLeft).
				Render

	List = lipgloss.NewStyle().
			BorderForeground(subtle)

	Header = lipgloss.NewStyle().
			Foreground(special).
			Bold(true).
			BorderStyle(lipgloss.NormalBorder()).
			BorderBottom(true).
			BorderForeground(subtle).
			Render

	ListItem = lipgloss.NewStyle().PaddingLeft(2).Render

	ListItemTick = func(s string) string {
		return tick + lipgloss.NewStyle().
			Render(s)
	}

	TextHighlight = lipgloss.NewStyle().
					Foreground(highlight).
					Render
)

Functions

func CreateDefault

func CreateDefault() error

CreateDefault creates a default template file

func PopulateFromForm

func PopulateFromForm(template Template) (string, error)

func PopulateTemplate

func PopulateTemplate(template Template, variables map[string]string) (string, error)

PopulateTemplate replaces variables in a template with values

func RenderList

func RenderList(title string, items []string) string

RenderList renders a list of strings

func Write

func Write(items ...string)

Write prints a list of strings to the terminal

func WriteNoMargin

func WriteNoMargin(items ...string)

WriteNoMargin prints a list of strings to the terminal

Types

type Template

type Template struct {
	Name        string     `yaml:"name"`
	Description string     `yaml:"description"`
	Text        string     `yaml:"text"`
	Variables   []Variable `yaml:"variables"`
}

Template is a git commit template

func ReadDefault

func ReadDefault() ([]Template, error)

ReadDefault reads the default template file

type Variable

type Variable struct {
	Name    string   `yaml:"name"`
	Type    string   `yaml:"type"`
	Options []string `yaml:"options"`
}

Varialbe is a variable in a git commit template

Jump to

Keyboard shortcuts

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