cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

type Wrapper struct {
	NewlineCount int
}

Wrapper is a proxy around fmt so we can manage clearing lines.

func Clearable

func Clearable() *Wrapper

Clearable lets you write to the terminal and clear it afterwards.

func (*Wrapper) Clear

func (w *Wrapper) Clear()

Clear will clear all written lines.

func (*Wrapper) Confirm

func (w *Wrapper) Confirm(defaultValue bool) (bool, error)

Confirm asks for user confirmation.

func (*Wrapper) Print

func (w *Wrapper) Print(args ...interface{}) (int, error)

Print does what you expect.

func (*Wrapper) Printf

func (w *Wrapper) Printf(fmtString string, args ...interface{}) (int, error)

Printf does what you expect.

func (*Wrapper) Println

func (w *Wrapper) Println(args ...interface{}) (int, error)

Println does what you expect.

func (*Wrapper) ReadLine

func (w *Wrapper) ReadLine() (string, error)

ReadLine does what you expect.

func (*Wrapper) SyncNewlines

func (w *Wrapper) SyncNewlines(str string)

SyncNewlines increments the internal newline counter by counting newlines in the specified string.

Jump to

Keyboard shortcuts

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