Back to

package zli

v0.0.0 (546efe8)
Latest Go to latest
Published: 1 day ago | License: MIT | Module:


func F

func F(err error)

F is like Fatal(), but won't do anything for nil errors.

func Fatal

func Fatal(s interface{}, args ...interface{})

Fatal prints the given message to stderr and exits.

Fatal("oh noes: %q", something)   // printf arguments
Fatal(err)                        // Print err.Error()
Fatal(123)                        // Print %v (makes little sense, but okay)

func FileOrInput

func FileOrInput(path string) (io.ReadCloser, error)

FileOrInput will read from stdin if path is "" or "-", or the path otherwise.

It will print a message to stderr notifying the user it's reading from stdin. See:

func IsTerminal

func IsTerminal(fd uintptr) bool

IsTerminal reports if this file descriptor is an interactive terminal.

func Pager

func Pager(out io.Reader)

Pager pipes the content of out to $PAGER, or prints it to stdout of this fails.

func Program

func Program() string

Program gets the program name from argv.

func TerminalSize

func TerminalSize(fd uintptr) (width, height int, err error)

TerminalSize gets the dimensions of the given terminal.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier