cmdstate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package cmdstate manages a running command state (the exit status).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtExit

func AtExit(f func())

AtExit will call f when Exit is called.

func Errorf

func Errorf(format string, args ...interface{})

Errorf prints the formatted message on os.Stderr and set the exit status to 1.

func Exit

func Exit()

Exit calls os.Exit with the exit status as set by SetExitStatus. It calls all the function registered by AtExit in FIFO order.

func ExitIfErrors

func ExitIfErrors()

ExitIfErrors will exit if the current exit status is not 0.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf prints the formatted message on os.Stderr and exit with exit status 1.

func GetExitStatus

func GetExitStatus() int

GetExitStatus returns the current exit status.

func SetExitStatus

func SetExitStatus(n int)

SetExitStatus sets the exit status to n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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