flags

package
v0.79.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: AGPL-3.0 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

func AreYouSure() bool

func ArgMustBeSpecifiedError

func ArgMustBeSpecifiedError(name string) error

func DoYouApproveTx

func DoYouApproveTx() bool

func GetConfirmedPassphrase

func GetConfirmedPassphrase(passphraseFile string) (string, error)

func GetConfirmedPassphraseWithContext added in v0.59.0

func GetConfirmedPassphraseWithContext(passphraseOptions PassphraseOptions, passphraseFile string) (string, error)

func GetPassphrase

func GetPassphrase(passphraseFile string) (string, error)

func GetPassphraseWithOptions added in v0.63.0

func GetPassphraseWithOptions(options PassphraseOptions, passphraseFile string) (string, error)

func InvalidFlagFormatError

func InvalidFlagFormatError(name string) error

func MustBase64EncodedError

func MustBase64EncodedError(name string) error

func MustBeSpecifiedError added in v0.55.0

func MustBeSpecifiedError(name string) error

func MutuallyExclusiveError added in v0.55.0

func MutuallyExclusiveError(n1, n2 string) error

func OneOfFlagsMustBeSpecifiedError

func OneOfFlagsMustBeSpecifiedError(n1, n2 string) error

func OneOfParentsFlagMustBeSpecifiedError

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

func ReadConfirmedPassphraseInput

func ReadConfirmedPassphraseInput(passphraseContext PassphraseOptions) (string, error)

func ReadPassphraseFile

func ReadPassphraseFile(passphraseFilePath string) (string, error)

func ReadPassphraseInput

func ReadPassphraseInput(options PassphraseOptions) (string, error)

func ReadPassphraseInputWithOpts

func ReadPassphraseInputWithOpts(passphraseOptions PassphraseOptions, withConfirmation bool) (string, error)

func RequireLessThanFlagError added in v0.55.0

func RequireLessThanFlagError(less, greater 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

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(PassphraseOptions, 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.

type PassphraseOptions added in v0.63.0

type PassphraseOptions struct {
	Name        string
	Description string
}

Jump to

Keyboard shortcuts

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