command

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildDate = "" // YYYY-MM-DD

BuildDate is dynamically set at build time in the Makefile.

View Source
var Confirm = func(prompt string, result *bool) error {
	p := &survey.Confirm{
		Message: prompt,
		Default: true,
	}
	return survey.AskOne(p, result)
}
View Source
var RootCmd = &cobra.Command{
	Use:   "gh <command> <subcommand> [flags]",
	Short: "GitHub CLI",
	Long:  `Work seamlessly with GitHub from the command line.`,

	SilenceErrors: true,
	SilenceUsage:  true,
}

RootCmd is the entry point of command-line execution

View Source
var Since = func(t time.Time) time.Duration {
	return time.Since(t)
}
View Source
var SurveyAsk = func(qs []*survey.Question, response interface{}, opts ...survey.AskOpt) error {
	return survey.Ask(qs, response, opts...)
}
View Source
var Version = "DEV"

Version is dynamically set by the toolchain or overridden by the Makefile.

Functions

func BasicClient

func BasicClient() (*api.Client, error)

BasicClient returns an API client that borrows from but does not depend on user configuration

func RunCommand added in v0.8.0

func RunCommand(args string) (*cmdOut, error)

Types

type Action

type Action int
const (
	SubmitAction Action = iota
	PreviewAction
	CancelAction
	MetadataAction
)

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

type Opts added in v0.9.0

type Opts struct {
	Description string
	Public      bool
}

type QuestionStub added in v0.6.2

type QuestionStub struct {
	Name    string
	Value   interface{}
	Default bool
}

Jump to

Keyboard shortcuts

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