cli

package
v0.3.3-beta.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//lint:ignore U1000 ansi color code, keep it for future use
	ANSIRed   = "\033[1;31m"
	ANSIGreen = "\033[1;32m"
	ANSICyan  = "\033[1;36m"
	ANSIGray  = "\033[1;90m"
	ANSIReset = "\033[0m"

	ANSIBlinkRed   = "\033[1;5;31m"
	ANSIBlinkGreen = "\033[1;5;32m"
	ANSIBlinkCyan  = "\033[1;5;36m"
)

https://stackoverflow.com/questions/8357203/is-it-possible-to-display-text-in-a-console-with-a-strike-through-effect https://en.wikipedia.org/wiki/ANSI_escape_code

Variables

This section is empty.

Functions

func DebugPrintlnf

func DebugPrintlnf(debug bool, pat string, args ...any)

func ErrorPrintlnf

func ErrorPrintlnf(pat string, args ...any)

func NamedPrintlnf added in v0.3.2

func NamedPrintlnf(pat string, p map[string]any)

func Printlnf

func Printlnf(pat string, args ...any)

func Run

func Run(rail CliRail, executable string, args []string, opts ...func(*exec.Cmd)) (out []byte, err error)

Runs command.

If err is not nil, out may still contain output from the command.

rail can be nil.

func RunPy

func RunPy(rail CliRail, pyExec string, pyContent string, args []string, opts ...func(*exec.Cmd)) (out []byte, err error)

Run python script.

Python executable must be available beforehand.

rail can be nil.

func TPrintlnf

func TPrintlnf(pat string, args ...any)

func TermOpenUrl

func TermOpenUrl(url string) error

Types

type CliRail

type CliRail interface {
	Infof(format string, args ...interface{})
	Context() context.Context
}

Jump to

Keyboard shortcuts

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