cmdutil

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SilentError = errors.New("SilentError")

SilentError is an error that triggers exit code 1 without any error messaging

Functions

func CheckAuth

func CheckAuth(cfg config.Config) bool

func DetermineEditor

func DetermineEditor(cf func() (config.Config, error)) (string, error)

TODO: consider passing via Factory TODO: support per-hostname settings

func DisableAuthCheck

func DisableAuthCheck(cmd *cobra.Command)

func EnableRepoOverride

func EnableRepoOverride(cmd *cobra.Command, f *Factory)

func IsAuthCheckEnabled

func IsAuthCheckEnabled(cmd *cobra.Command) bool

func MinimumArgs

func MinimumArgs(n int, msg string) cobra.PositionalArgs

func NoArgsQuoteReminder

func NoArgsQuoteReminder(cmd *cobra.Command, args []string) error

Types

type Factory

type Factory struct {
	IOStreams  *iostreams.IOStreams
	HttpClient func() (*http.Client, error)
	BaseRepo   func() (repox.Interface, error)
	Remotes    func() (context.Remotes, error)
	Config     func() (config.Config, error)
	Branch     func() (string, error)
}

type FlagError

type FlagError struct {
	Err error
}

FlagError is the kind of error raised in flag processing

func (FlagError) Error

func (fe FlagError) Error() string

func (FlagError) Unwrap

func (fe FlagError) Unwrap() error

Jump to

Keyboard shortcuts

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