Documentation ¶
Index ¶
- Variables
- func CheckAuth(cfg config.Config) bool
- func DisableAuthCheck(cmd *cobra.Command)
- func ExactArgs(n int, msg string) cobra.PositionalArgs
- func FlagErrorWrap(err error) error
- func FlagErrorf(format string, args ...interface{}) error
- func IsAuthCheckEnabled(cmd *cobra.Command) bool
- func IsUserCancellation(err error) bool
- func MinimumArgs(n int, msg string) cobra.PositionalArgs
- func MutuallyExclusive(message string, conditions ...bool) error
- func NilBoolFlag(cmd *cobra.Command, p **bool, name string, shorthand string, usage string) *pflag.Flag
- func NilStringFlag(cmd *cobra.Command, p **string, name string, shorthand string, usage string) *pflag.Flag
- func NoArgsQuoteReminder(cmd *cobra.Command, args []string) error
- func RegisterBranchCompletionFlags(gitc gitClient, cmd *cobra.Command, flags ...string) error
- func StringEnumFlag(cmd *cobra.Command, p *string, name, shorthand, defaultValue string, ...) *pflag.Flag
- func StringSliceEnumFlag(cmd *cobra.Command, p *[]string, name, shorthand string, ...) *pflag.Flag
- type Authenticator
- type CmdContext
- type ExternalCommandExitError
- type FlagError
- type NoResultsError
Constants ¶
This section is empty.
Variables ¶
var ErrCancel = errors.New("CancelError")
CancelError signals user-initiated cancellation
var ErrSilent = errors.New("SilentError")
SilentError is an error that triggers exit code 1 without any error messaging
Functions ¶
func DisableAuthCheck ¶
func FlagErrorWrap ¶
FlagError returns a new FlagError that wraps the specified error.
func FlagErrorf ¶
FlagErrorf returns a new FlagError that wraps an error produced by fmt.Errorf(format, args...).
func IsAuthCheckEnabled ¶
func IsUserCancellation ¶
func MinimumArgs ¶
func MinimumArgs(n int, msg string) cobra.PositionalArgs
func MutuallyExclusive ¶
func NilBoolFlag ¶
func NilBoolFlag(cmd *cobra.Command, p **bool, name string, shorthand string, usage string) *pflag.Flag
NilBoolFlag defines a new flag with a bool pointer receiver. This is useful for differentiating between the flag being explicitly set to a false value and the flag not being passed at all.
func NilStringFlag ¶
func NilStringFlag(cmd *cobra.Command, p **string, name string, shorthand string, usage string) *pflag.Flag
NilStringFlag defines a new flag with a string pointer receiver. This is useful for differentiating between the flag being set to a blank value and the flag not being passed at all.
func RegisterBranchCompletionFlags ¶
RegisterBranchCompletionFlags suggests and autocompletes known remote git branches for flags passed
Types ¶
type Authenticator ¶
func NewPatAuthenticator ¶
func NewPatAuthenticator(cfg config.Config) (instance Authenticator, err error)
type CmdContext ¶
type CmdContext interface { Prompter() (prompter.Prompter, error) Context() (context.Context, error) Config() (config.Config, error) Connection(organization string) (*azuredevops.Connection, error) IOStreams() (*iostreams.IOStreams, error) Printer(string) (printer.Printer, error) GitClient() (*git.Client, error) }
func NewCmdContext ¶
func NewCmdContext() (ctx CmdContext, err error)
type ExternalCommandExitError ¶ added in v0.0.2
type ExternalCommandExitError struct {
// contains filtered or unexported fields
}
func NewExternalCommandExitError ¶
func NewExternalCommandExitError(err *exec.ExitError) ExternalCommandExitError
func (ExternalCommandExitError) Error ¶ added in v0.0.2
func (e ExternalCommandExitError) Error() string
func (ExternalCommandExitError) ExitCode ¶ added in v0.0.2
func (e ExternalCommandExitError) ExitCode() int
type FlagError ¶ added in v0.0.2
type FlagError struct {
// contains filtered or unexported fields
}
A *FlagError indicates an error processing command-line flags or other arguments. Such errors cause the application to display the usage message.
type NoResultsError ¶ added in v0.0.2
type NoResultsError struct {
// contains filtered or unexported fields
}
func NewNoResultsError ¶
func NewNoResultsError(message string) NoResultsError
func (NoResultsError) Error ¶ added in v0.0.2
func (e NoResultsError) Error() string