flags

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InteractiveOutput = "interactive"
	JSONOutput        = "json"
)

Variables

View Source
var (
	ErrUnsupportedOutput = errors.New("unsupported output")

	AvailableOutputs = []string{
		InteractiveOutput,
		JSONOutput,
	}
)
View Source
var (
	ErrPassphraseRequiredWithoutTTY = errors.New("passphrase flag is required without TTY")
	ErrPassphraseDoNotMatch         = errors.New("passphrases do not match")
	ErrPassphraseMustBeSpecified    = errors.New("passphrase must be specified")
	ErrMsysPasswordInput            = errors.New("password input is not supported on msys (use --passphrase-file or a standard windows terminal)")
)

Functions

func AreYouSure added in v0.14.0

func AreYouSure() bool

func ArgMustBeSpecifiedError

func ArgMustBeSpecifiedError(name string) error

func DoYouApproveTx added in v0.14.0

func DoYouApproveTx() bool

func FlagMustBeSpecifiedError

func FlagMustBeSpecifiedError(name string) error

func FlagRequireLessThanFlagError added in v0.11.0

func FlagRequireLessThanFlagError(less, greater string) error

func FlagsMutuallyExclusiveError

func FlagsMutuallyExclusiveError(n1, n2 string) error

func GetConfirmedPassphrase added in v0.11.0

func GetConfirmedPassphrase(passphraseFile string) (string, error)

func GetPassphrase

func GetPassphrase(passphraseFile string) (string, error)

func InvalidFlagFormatError

func InvalidFlagFormatError(name string) error

func MustBase64EncodedError

func MustBase64EncodedError(name string) error

func OneOfFlagsMustBeSpecifiedError

func OneOfFlagsMustBeSpecifiedError(n1, n2 string) error

func OneOfParentsFlagMustBeSpecifiedError added in v0.11.0

func OneOfParentsFlagMustBeSpecifiedError(name string, parents ...string) error

func ReadConfirmedPassphraseInput

func ReadConfirmedPassphraseInput() (string, error)

func ReadPassphraseFile

func ReadPassphraseFile(passphraseFilePath string) (string, error)

func ReadPassphraseInput

func ReadPassphraseInput() (string, error)

func ReadPassphraseInputWithOpts

func ReadPassphraseInputWithOpts(withConfirmation bool) (string, error)

func TooManyArgsError

func TooManyArgsError(names ...string) error

func UnsupportedFlagValueError

func UnsupportedFlagValueError(name string, unsupported interface{}, supported []interface{}) error

func ValidateOutput

func ValidateOutput(output string) error

func YesOrNo added in v0.14.0

func YesOrNo(question string) bool

Types

type FlagError

type FlagError struct {
	// contains filtered or unexported fields
}

func (FlagError) Error

func (f FlagError) Error() string

type PassphraseGetterWithOps

type PassphraseGetterWithOps func(bool) (string, error)

func BuildPassphraseGetterWithOps

func BuildPassphraseGetterWithOps(passphraseFile string) PassphraseGetterWithOps

BuildPassphraseGetterWithOps builds a function that returns a passphrase. If passphraseFile is set, the returned function is built to read a file. If it's not set, the returned function is built to read from user input. The one based on the user input takes an argument withConfirmation that asks for passphrase confirmation base on its value.

Jump to

Keyboard shortcuts

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