Documentation
¶
Overview ¶
Package for CLI operations.
Index ¶
- Constants
- func DebugPrintlnf(debug bool, pat string, args ...any)
- func ErrorPrintlnf(pat string, args ...any)
- func LogWithCaller(cond ...func(level string) bool) func(*cliLogger)
- func LogWithDebug(debug *bool) func(*cliLogger)
- func LogWithTime(cond ...func(level string) bool) func(*cliLogger)
- func NamedPrintlnf(pat string, p map[string]any)
- func NewLog(op ...func(l *cliLogger)) *cliLogger
- func PkgVersion(location string, pkg string) (string, error)
- func Printf(pat string, args ...any)
- func Printlnf(pat string, args ...any)
- func Run(rail CliRail, executable string, args []string, opts ...func(*exec.Cmd)) (out []byte, err error)
- func RunPy(rail CliRail, pyExec string, pyContent string, args []string, ...) (out []byte, err error)
- func TPrintlnf(pat string, args ...any)
- func TermOpenUrl(url string) error
- type CliRail
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 ErrorPrintlnf ¶
func LogWithCaller ¶ added in v0.3.5
func LogWithDebug ¶ added in v0.3.5
func LogWithDebug(debug *bool) func(*cliLogger)
func LogWithTime ¶ added in v0.3.5
func NamedPrintlnf ¶ added in v0.3.2
func PkgVersion ¶ added in v0.4.0
Get dependency package version in current working directory.
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 TermOpenUrl ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.