Documentation
¶
Index ¶
- Variables
- func FuzzyAgo(ago time.Duration) string
- func Humanize(s string) string
- func IsTerminal(f *os.File) bool
- func NewColorable(f *os.File) io.Writer
- func OpenInBrowser(url string) error
- func Pluralize(num int, thing string) string
- func RenderMarkdown(text string) (string, error)
- func Spinner(w io.Writer) *spinner.Spinner
- type TablePrinter
Constants ¶
This section is empty.
Variables ¶
var Blue = makeColorFunc("blue")
Blue outputs ANSI color if stdout is a tty
var Bold = makeColorFunc("default+b")
Bold outputs ANSI color if stdout is a tty
var Cyan = makeColorFunc("cyan")
Cyan outputs ANSI color if stdout is a tty
var Gray = makeColorFunc("black+h")
Gray outputs ANSI color if stdout is a tty
var Green = makeColorFunc("green")
Green outputs ANSI color if stdout is a tty
var Magenta = makeColorFunc("magenta")
Magenta outputs ANSI color if stdout is a tty
var Red = makeColorFunc("red")
Red outputs ANSI color if stdout is a tty
var StartSpinner = func(s *spinner.Spinner) {
s.Start()
}
We do this so we can stub out the spinner in tests -- it made things really flakey. this is not an elegant solution.
var StopSpinner = func(s *spinner.Spinner) {
s.Stop()
}
var Yellow = makeColorFunc("yellow")
Yellow outputs ANSI color if stdout is a tty
Functions ¶
func IsTerminal ¶ added in v0.6.0
IsTerminal reports whether the file descriptor is connected to a terminal
func NewColorable ¶
NewColorable returns an output stream that handles ANSI color sequences on Windows
func OpenInBrowser ¶
OpenInBrowser opens the url in a web browser based on OS and $BROWSER environment variable
func RenderMarkdown ¶
Types ¶
type TablePrinter ¶
type TablePrinter interface {
IsTTY() bool
AddField(string, func(int, string) string, func(string) string)
EndRow()
Render() error
}
func NewTablePrinter ¶
func NewTablePrinter(w io.Writer) TablePrinter