flag

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Set via config
	Origin   Remote
	Upstream Remote

	// Set via flags
	URL   string
	Owner string
	Repo  string
	Token string

	// Set via Before
	OwnerRepoCtxSet bool

	Flags = []cli.Flag{
		&cli.StringFlag{
			Name:        "origin",
			Usage:       "The origin remote",
			Value:       config.Origin,
			Destination: &Origin.Name,
		},
		&cli.StringFlag{
			Name:        "upstream",
			Usage:       "The upstream remote",
			Value:       config.Upstream,
			Destination: &Upstream.Name,
		},
		&cli.StringFlag{
			Name:        "url",
			Aliases:     []string{"u"},
			Usage:       "The base URL to the Gitea instance",
			Value:       getUpstream().URL,
			Destination: &URL,
		},
		&cli.StringFlag{
			Name:        "owner",
			Aliases:     []string{"o"},
			Usage:       "The owner to target",
			Value:       getUpstream().Owner,
			Destination: &Owner,
		},
		&cli.StringFlag{
			Name:        "repo",
			Aliases:     []string{"r"},
			Usage:       "The repo to target",
			Value:       getUpstream().Repo,
			Destination: &Repo,
		},
		&cli.StringFlag{
			Name:        "token",
			Aliases:     []string{"t"},
			Usage:       "The access token to use (by name)",
			Destination: &Token,
		},
	}
)

Functions

func Before

func Before(ctx *cli.Context) error

func FullName

func FullName() string

func FullURL

func FullURL() string

Types

type Remote

type Remote struct {
	Name  string
	URL   string
	Owner string
	Repo  string
}

Jump to

Keyboard shortcuts

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