cmd

package
v0.0.0-...-3b352fe Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdIssues = cli.Command{
	Name:        "issues",
	Usage:       "Operate with issues of the repository",
	Description: `Operate with issues of the repository`,
	Action:      runIssues,
	Subcommands: []cli.Command{
		CmdIssuesList,
		CmdIssuesCreate,
	},
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "login, l",
			Usage: "Indicate one login, optional when inside a gitea repository",
		},
		cli.StringFlag{
			Name:  "repo, r",
			Usage: "Indicate one repository, optional when inside a gitea repository",
		},
	},
}

CmdIssues represents to login a gitea server.

View Source
var CmdIssuesCreate = cli.Command{
	Name:        "create",
	Usage:       "Create an issue on repository",
	Description: `Create an issue on repository`,
	Action:      runIssuesCreate,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "title, t",
			Usage: "issue title to create",
		},
		cli.StringFlag{
			Name:  "body, b",
			Usage: "issue body to create",
		},
	},
}

CmdIssuesCreate represents a sub command of issues to create issue

View Source
var CmdIssuesList = cli.Command{
	Name:        "ls",
	Usage:       "List issues of the repository",
	Description: `List issues of the repository`,
	Action:      runIssuesList,
}

CmdIssuesList represents a sub command of issues to list issues

View Source
var CmdLogin = cli.Command{
	Name:        "login",
	Usage:       "Log in a Gitea server",
	Description: `Log in a Gitea server`,
	Action:      runLoginList,
	Subcommands: []cli.Command{
		cmdLoginList,
		cmdLoginAdd,
	},
}

CmdLogin represents to login a gitea server.

View Source
var CmdLogout = cli.Command{
	Name:        "logout",
	Usage:       "Log out from a Gitea server",
	Description: `Log out from a Gitea server`,
	Action:      runLogout,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "name, n",
			Usage: "name wants to log out",
		},
	},
}

CmdLogout represents to logout a gitea server.

View Source
var CmdPull = cli.Command{
	Name:        "pull",
	Usage:       "Operate with pull of the repository",
	Description: `Operate with pull of the repository and returns the pull request's body message`,
	Action:      runPull,
	ArgsUsage:   "[<pull request index>]",
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "login, l",
			Usage: "Indicate one login, optional when inside a gitea repository",
		},
		cli.StringFlag{
			Name:  "repo, r",
			Usage: "Indicate one repository, optional when inside a gitea repository",
		},
		cli.BoolFlag{
			Name:  "merge, mg",
			Usage: "Merge a certain pull request",
		},
	},
}

CmdPull represents to login a gitea server.

View Source
var CmdPulls = cli.Command{
	Name:        "pulls",
	Usage:       "Operate with pulls of the repository",
	Description: `Operate with pulls of the repository`,
	Action:      runPulls,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "login, l",
			Usage: "Indicate one login, optional when inside a gitea repository",
		},
		cli.StringFlag{
			Name:  "repo, r",
			Usage: "Indicate one repository, optional when inside a gitea repository",
		},
		cli.BoolFlag{
			Name:  "matchLogin, ml",
			Usage: "Results will be filtered to match the current login value",
		},
		cli.StringFlag{
			Name:  "match, m",
			Usage: "Results will be filtered according to the supplied name value",
		},
	},
}

CmdPulls represents to login a gitea server.

View Source
var CmdReleaseCreate = cli.Command{
	Name:        "create",
	Usage:       "Create a release in repository",
	Description: `Create a release in repository`,
	Action:      runReleaseCreate,
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "tag",
			Usage: "release tag name",
		},
		cli.StringFlag{
			Name:  "target",
			Usage: "release target refs, branch name or commit id",
		},
		cli.StringFlag{
			Name:  "title, t",
			Usage: "release title to create",
		},
		cli.StringFlag{
			Name:  "note, n",
			Usage: "release note to create",
		},
		cli.BoolFlag{
			Name:  "draft, d",
			Usage: "the release is a draft",
		},
		cli.BoolFlag{
			Name:  "prerelease, p",
			Usage: "the release is a prerelease",
		},
		cli.StringSliceFlag{
			Name:  "asset, a",
			Usage: "a list of files to attach to the release",
		},
	},
}

CmdReleaseCreate represents a sub command of Release to create release.

View Source
var CmdReleases = cli.Command{
	Name:        "releases",
	Usage:       "Operate with releases of the repository",
	Description: `Operate with releases of the repository`,
	Action:      runReleases,
	Subcommands: []cli.Command{
		CmdReleaseCreate,
	},
	Flags: []cli.Flag{
		cli.StringFlag{
			Name:  "login, l",
			Usage: "Indicate one login, optional when inside a gitea repository",
		},
		cli.StringFlag{
			Name:  "repo, r",
			Usage: "Indicate one repository, optional when inside a gitea repository",
		},
	},
}

CmdReleases represents to login a gitea server.

Functions

func Error

func Error(a ...interface{})

Error println content as an error information

func Errorf

func Errorf(format string, a ...interface{})

Errorf printf content as an error information

func Printf

func Printf(format string, a ...interface{})

Printf printf content according the flag

func Println

func Println(a ...interface{})

Println println content according the flag

Types

type Config

type Config struct {
	Logins []Login `yaml:"logins"`
}

Config reprensents local configurations

type Login

type Login struct {
	Name     string `yaml:"name"`
	URL      string `yaml:"url"`
	Token    string `yaml:"token"`
	Active   bool   `yaml:"active"`
	SSHHost  string `yaml:"ssh_host"`
	Insecure bool   `yaml:"insecure"`
}

Login represents a login to a gitea server, you even could add multiple logins for one gitea server

func (*Login) Client

func (l *Login) Client() *gitea.Client

Client returns a client to operate Gitea API

func (*Login) GetSSHHost

func (l *Login) GetSSHHost() string

GetSSHHost returns SSH host name

Jump to

Keyboard shortcuts

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