command

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 45 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 RootCmd = &cobra.Command{
	Use:   "gh <command> <subcommand> [flags]",
	Short: "GitHub CLI",
	Long:  `Work seamlessly with GitHub from the command line.`,

	SilenceErrors: true,
	SilenceUsage:  true,
	Example: heredoc.Doc(`
	$ gh issue create
	$ gh repo clone cli/cli
	$ gh pr checkout 321
	`),
	Annotations: map[string]string{
		"help:feedback": heredoc.Doc(`
			Fill out our feedback form https://forms.gle/umxd3h31c7aMQFKG7
			Open an issue using “gh issue create -R cli/cli”
		`),
		"help:environment": heredoc.Doc(`
			GITHUB_TOKEN: an authentication token for API requests. Setting this avoids being
			prompted to authenticate and overrides any previously stored credentials.

			GH_REPO: specify the GitHub repository in "OWNER/REPO" format for commands that
			otherwise operate on a local repository.

			GH_EDITOR, GIT_EDITOR, VISUAL, EDITOR (in order of precedence): the editor tool to use
			for authoring text.

			BROWSER: the web browser to use for opening links.

			DEBUG: set to any value to enable verbose output to standard error. Include values "api"
			or "oauth" to print detailed information about HTTP requests or authentication flow.

			GLAMOUR_STYLE: the style to use for rendering Markdown. See
			https://github.com/charmbracelet/glamour#styles

			NO_COLOR: avoid printing ANSI escape sequences for color output.
		`),
	},
}

RootCmd is the entry point of command-line execution

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 ExecuteShellAlias added in v0.11.0

func ExecuteShellAlias(args []string) error

func ExpandAlias added in v0.10.0

func ExpandAlias(args []string) (expanded []string, isShell bool, err error)

ExpandAlias processes argv to see if it should be rewritten according to a user's aliases. The second return value indicates whether the alias should be executed in a new shell process instead of running gh itself.

func HasFailed added in v0.10.1

func HasFailed() bool

HasFailed signals that the main process should exit with non-zero status

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 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