cli

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultEnv is the default environment used by commands
	DefaultEnv = &Env{
		Stdin:  os.Stdin,
		Stdout: os.Stdout,
		Stderr: os.Stderr,
	}
)

Functions

func SetUmask

func SetUmask(log logrus.FieldLogger)

SetUmask sets the minimumUmask.

Types

type CommaStringsFlag

type CommaStringsFlag []string

CommaStringsFlag facilitates parsing flags representing a comma separated list of strings

func (*CommaStringsFlag) Set

func (f *CommaStringsFlag) Set(v string) error

func (CommaStringsFlag) String

func (f CommaStringsFlag) String() string

type DurationFlag

type DurationFlag time.Duration

DurationFlag facilitates parsing flags representing a time.Duration

func (*DurationFlag) Set

func (f *DurationFlag) Set(v string) error

func (DurationFlag) String

func (f DurationFlag) String() string

type Env

type Env struct {
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
	BaseDir string
}

Env provides an pluggable environment for CLI commands that facilitates easy testing.

func (*Env) ErrPrintf

func (e *Env) ErrPrintf(format string, args ...interface{}) error

func (*Env) ErrPrintln

func (e *Env) ErrPrintln(args ...interface{}) error

func (*Env) JoinPath

func (e *Env) JoinPath(parts ...string) string

func (*Env) Printf

func (e *Env) Printf(format string, args ...interface{}) error

func (*Env) Println

func (e *Env) Println(args ...interface{}) error

type StringsFlag

type StringsFlag []string

StringsFlag faciliates setting multiple flags

func (*StringsFlag) Set

func (s *StringsFlag) Set(val string) error

func (*StringsFlag) String

func (s *StringsFlag) String() string

Jump to

Keyboard shortcuts

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