decls

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToStringModeList = iota
	ToStringModeRun
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decl

type Decl struct {
	Name     string         `toml:"name"`
	Preset   string         `toml:"preset"`
	Priority Priority       `toml:"priority"`
	Pwd      string         `toml:"pwd"`
	Args     map[string]any `toml:"args"`
	// contains filtered or unexported fields
}

Decl is the info for a single declaration

func (Decl) List

func (decl Decl) List(w io.Writer, mode int8, prestr string) error

func (*Decl) Load

func (decl *Decl) Load(path string) error

func (Decl) Run

func (decl Decl) Run(opts cmdtype.CmdRunOptions) error

type Decls

type Decls []Decl

Decls is a slice of Decl, just for []Decl to be receiver type

func GetDecls

func GetDecls(ddir string) (Decls, error)

func (Decls) List

func (decls Decls) List(w io.Writer, opts DeclsListOpts) error

func (Decls) Run

func (decls Decls) Run(opts DeclsRunOpts) error

RunDecls runs the decls by their priority, from high to low. priority filters out other priorities, use nil for no filter

type DeclsListOpts

type DeclsListOpts struct {
	Indent         int
	FilterPriority int // negative for no filter
}

type DeclsRunOpts

type DeclsRunOpts struct {
	Indent         uint
	WorkingDir     string
	FilterPriority int // negative for no filter
	Dry            bool
	RedirectStdout io.Writer
	RedirectStderr io.Writer
	// contains filtered or unexported fields
}

type Priority

type Priority = uint

Jump to

Keyboard shortcuts

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