Skip to content

A simple wrapper for go-pretty for commonly used formatted prints

License

Notifications You must be signed in to change notification settings

asciifaceman/hobocode

Repository files navigation

Hobocode

Hobocode is a pty-aware colorized printing library intended for use in CLI applications for human consumption and UX rather than structured outputs.

Uses go-pretty v6 for colors and Sprinting.

	hobocode.Header("Hobocode Example")
	hobocode.Success("Welcome to hobocode")

hobocode_example

The underlying functions can be used if you are working with custom *os.File's or you can use the lazy opinionated helpers like

Plain

hobocode.Warn("Something might be going wrong")

Formatted

hobocode.Debugf("Output: %v", ret.Body())

Indented

hobocode.Ierror(2, "Something went terribly wrong")

Indented and Formatted

hobocode.Iinfof(1, "Date: %s", time.Now().Format("2006/01/02"))

Example

See examples

import (
    "github.com/asciifaceman/hobocode"
)

func main() {
    userinput := hobocode.Input("nvim", "What is your preferred editor?")

    hobocode.Notef("You chose: %s", userinput)
}

example

About

A simple wrapper for go-pretty for commonly used formatted prints

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages