flags

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GlobalLoginValue contain value of --login|-l arg
	GlobalLoginValue string
	// GlobalRepoValue contain value of --repo|-r arg
	GlobalRepoValue string
	// GlobalOutputValue contain value of --output|-o arg
	GlobalOutputValue string
	// GlobalRemoteValue contain value of --remote|-R arg
	GlobalRemoteValue string
)

create global variables for global Flags to simplify access to the options without requiring cli.Context

View Source
var AllDefaultFlags = append([]cli.Flag{
	&RepoFlag,
	&RemoteFlag,
}, LoginOutputFlags...)

AllDefaultFlags defines flags that should be available for all subcommands working with dedicated repositories to work around issue and provide --login, --repo and --output: https://github.com/urfave/cli/issues/585

IssuePRFlags defines flags that should be available on issue & pr listing flags.

View Source
var LoginFlag = cli.StringFlag{
	Name:        "login",
	Aliases:     []string{"l"},
	Usage:       "Use a different Gitea login. Optional",
	Destination: &GlobalLoginValue,
}

LoginFlag provides flag to specify tea login profile

View Source
var LoginOutputFlags = []cli.Flag{
	&LoginFlag,
	&OutputFlag,
}

LoginOutputFlags defines login and output flags that should added to all subcommands and appended to the flags of the subcommand to work around issue and provide --login and --output: https://github.com/urfave/cli/issues/585

View Source
var LoginRepoFlags = []cli.Flag{
	&LoginFlag,
	&RepoFlag,
	&RemoteFlag,
}

LoginRepoFlags defines login and repo flags that should be used for all subcommands and appended to the flags of the subcommand to work around issue and provide --login and --repo: https://github.com/urfave/cli/issues/585

View Source
var OutputFlag = cli.StringFlag{
	Name:        "output",
	Aliases:     []string{"o"},
	Usage:       "Output format. (csv, simple, table, tsv, yaml)",
	Destination: &GlobalOutputValue,
}

OutputFlag provides flag to specify output type

View Source
var PaginationLimitFlag = cli.StringFlag{
	Name:    "limit",
	Aliases: []string{"lm"},
	Usage:   "specify limit of items per page",
}

PaginationLimitFlag provides flag for pagination options

View Source
var PaginationPageFlag = cli.StringFlag{
	Name:    "page",
	Aliases: []string{"p"},
	Usage:   "specify page, default is 1",
}

PaginationPageFlag provides flag for pagination options

View Source
var RemoteFlag = cli.StringFlag{
	Name:        "remote",
	Aliases:     []string{"R"},
	Usage:       "Discover Gitea login from remote. Optional",
	Destination: &GlobalRemoteValue,
}

RemoteFlag provides flag to specify remote repository

View Source
var RepoFlag = cli.StringFlag{
	Name:        "repo",
	Aliases:     []string{"r"},
	Usage:       "Override local repository path or gitea repository slug to interact with. Optional",
	Destination: &GlobalRepoValue,
}

RepoFlag provides flag to specify repository

View Source
var StateFlag = cli.StringFlag{
	Name:        "state",
	Usage:       "Filter by state (all|open|closed)",
	DefaultText: "open",
}

StateFlag provides flag to specify issue/pr state, defaulting to "open"

Functions

func GetListOptions

func GetListOptions(ctx *cli.Context) gitea.ListOptions

GetListOptions return ListOptions based on PaginationFlags

Types

This section is empty.

Jump to

Keyboard shortcuts

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