Documentation
¶
Overview ¶
Handles terminal input/output. Based on GH CLI implementation at https://github.com/cli/cli/blob/trunk/pkg/iostreams/iostreams.go
Index ¶
- Variables
- func Error(s string)
- func Errorf(s string, args ...any)
- func IsInteractive() bool
- func IsTerminal(f *os.File) bool
- func NewStyle(enabled, is256enabled, trueColor bool) *style
- func Print(s string)
- func PrintErr(s string)
- func Printf(s string, args ...any)
- func StderrIsTerminal() bool
- func StdinIsTerminal() bool
- func StdoutIsTerminal() bool
- func Style() *style
- func Warn(s string)
- func Warnf(s string, args ...any)
- type Config
- type IO
- func (io *IO) Error(s string)
- func (io *IO) Errorf(s string, args ...any)
- func (io *IO) IsInteractive() bool
- func (io *IO) Print(s string)
- func (io *IO) PrintErr(s string)
- func (io *IO) Printf(s string, args ...any)
- func (io *IO) SetNeverPrompt(v bool)
- func (io *IO) StderrIsTerminal() bool
- func (io *IO) StdinIsTerminal() bool
- func (io *IO) StdoutIsTerminal() bool
- func (io *IO) Style() *style
- func (io *IO) Warn(s string)
- func (io *IO) Warnf(s string, args ...any)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultIO = New()
)
Functions ¶
func IsInteractive ¶
func IsInteractive() bool
func IsTerminal ¶
func StderrIsTerminal ¶
func StderrIsTerminal() bool
func StdinIsTerminal ¶
func StdinIsTerminal() bool
func StdoutIsTerminal ¶
func StdoutIsTerminal() bool
Types ¶
type Config ¶
func ConfigFromEnv ¶
func ConfigFromEnv() *Config
type IO ¶
type IO struct { In io.Reader Out io.Writer ErrOut io.Writer // contains filtered or unexported fields }
func NewWithConfig ¶
func WithNeverPrompt ¶
func (*IO) IsInteractive ¶
func (*IO) SetNeverPrompt ¶
func (*IO) StderrIsTerminal ¶
func (*IO) StdinIsTerminal ¶
func (*IO) StdoutIsTerminal ¶
Click to show internal directories.
Click to hide internal directories.