apputil

package
v0.0.0-...-d4978fa Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name, usage string, dest *bool) *cli.BoolFlag

Bool returns an cli.BoolFlag

func BoolTrue

func BoolTrue(name, usage string, dest *bool) *cli.BoolTFlag

BoolTrue returns a CliBoolFlag that defaults to true

func Duration

func Duration(name, usage string, value time.Duration, dest *time.Duration) *cli.DurationFlag

Duration returns an cli.DurationFlag

func EnsureDir

func EnsureDir(fileName string)

EnsureDir checks a file could be written to a path, creates the directories as needed

func FileExists

func FileExists(filePath string) bool

FileExists reports whether the named file or directory exists.

func Float64

func Float64(name, usage string, value float64, dest *float64) *cli.Float64Flag

Float64 returns an cli.Float64Flag

func Int

func Int(name, usage string, value int, dest *int) *cli.IntFlag

Int returns an cli.IntFlag

func Join

func Join(path, filename string) string

Join joins together a path and filename

func Lang

func Lang(name, usage, value string, dest *string) *cli.StringFlag

Lang returns an cli.StringFlag

func MinUint32

func MinUint32(a, b uint32) uint32

MinUint32 is a helper function to return the minimum of two uint32s. This avoids a math import and the need to cast to floats.

func NewCommand

func NewCommand(
	name string,
	usage string,
	action interface{},
	subcommands cli.Commands,
	aliases ...string,
) cli.Command

NewCommand returns a cli.Command

func RightJustify

func RightJustify(s string, w int) string

RightJustify takes a string and right justifies it by a width or crops it

func String

func String(name, usage, value string, dest *string) *cli.StringFlag

String returns an cli.StringFlag

func StringSlice

func StringSlice(name, usage string, value *cli.StringSlice) *cli.StringSliceFlag

StringSlice returns and cli.StringSliceFlag

func SubCommands

func SubCommands(sc ...cli.Command) []cli.Command

SubCommands returns a slice of cli.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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