Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
var CmdIssues = cli.Command{ Name: "issues", Usage: "List and create issues", Description: `List and create issues`, Action: runIssues, Subcommands: []cli.Command{ CmdIssuesList, CmdIssuesCreate, }, Flags: AllDefaultFlags, }
CmdIssues represents to login a gitea server.
var CmdIssuesCreate = cli.Command{ Name: "create", Usage: "Create an issue on repository", Description: `Create an issue on repository`, Action: runIssuesCreate, Flags: append([]cli.Flag{ cli.StringFlag{ Name: "title, t", Usage: "issue title to create", }, cli.StringFlag{ Name: "body, b", Usage: "issue body to create", }, }, LoginRepoFlags...), }
CmdIssuesCreate represents a sub command of issues to create issue
var CmdIssuesList = cli.Command{ Name: "ls", Usage: "List issues of the repository", Description: `List issues of the repository`, Action: runIssuesList, Flags: AllDefaultFlags, }
CmdIssuesList represents a sub command of issues to list issues
var CmdLabelCreate = cli.Command{ Name: "create", Usage: "Create a label", Description: `Create a label`, Action: runLabelCreate, Flags: []cli.Flag{ cli.StringFlag{ Name: "name", Usage: "label name", }, cli.StringFlag{ Name: "color", Usage: "label color value", }, cli.StringFlag{ Name: "description", Usage: "label description", }, cli.StringFlag{ Name: "file", Usage: "indicate a label file", }, }, }
CmdLabelCreate represents a sub command of labels to create label.
var CmdLabelDelete = cli.Command{ Name: "delete", Usage: "Delete a label", Description: `Delete a label`, Action: runLabelCreate, Flags: []cli.Flag{ cli.IntFlag{ Name: "id", Usage: "label id", }, }, }
CmdLabelDelete represents a sub command of labels to delete label.
var CmdLabelUpdate = cli.Command{ Name: "update", Usage: "Update a label", Description: `Update a label`, Action: runLabelUpdate, Flags: []cli.Flag{ cli.IntFlag{ Name: "id", Usage: "label id", }, cli.StringFlag{ Name: "name", Usage: "label name", }, cli.StringFlag{ Name: "color", Usage: "label color value", }, cli.StringFlag{ Name: "description", Usage: "label description", }, }, }
CmdLabelUpdate represents a sub command of labels to update label.
var CmdLabels = cli.Command{ Name: "labels", Usage: "Manage issue labels", Description: `Manage issue labels`, Action: runLabels, Subcommands: []cli.Command{ CmdLabelCreate, CmdLabelUpdate, CmdLabelDelete, }, Flags: append([]cli.Flag{ cli.StringFlag{ Name: "save, s", Usage: "Save all the labels as a file", }, }, AllDefaultFlags...), }
CmdLabels represents to operate repositories' labels.
var CmdLogin = cli.Command{ Name: "login", Usage: "Log in to a Gitea server", Description: `Log in to a Gitea server`, Subcommands: []cli.Command{ cmdLoginList, cmdLoginAdd, }, }
CmdLogin represents to login a gitea server.
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: "Login name to remove", }, }, }
CmdLogout represents to logout a gitea server.
var CmdPulls = cli.Command{ Name: "pulls", Usage: "List open pull requests", Description: `List open pull requests`, Action: runPulls, Flags: AllDefaultFlags, }
CmdPulls represents to login a gitea server.
var CmdReleaseCreate = cli.Command{ Name: "create", Usage: "Create a release", Description: `Create a release`, Action: runReleaseCreate, Flags: append([]cli.Flag{ cli.StringFlag{ Name: "tag", Usage: "Tag name", }, cli.StringFlag{ Name: "target", Usage: "Target refs, branch name or commit id", }, cli.StringFlag{ Name: "title, t", Usage: "Release title", }, cli.StringFlag{ Name: "note, n", Usage: "Release notes", }, cli.BoolFlag{ Name: "draft, d", Usage: "Is a draft", }, cli.BoolFlag{ Name: "prerelease, p", Usage: "Is a pre-release", }, cli.StringSliceFlag{ Name: "asset, a", Usage: "List of files to attach", }, }, LoginRepoFlags...), }
CmdReleaseCreate represents a sub command of Release to create release.
var CmdReleases = cli.Command{ Name: "releases", Usage: "Create releases", Description: `Create releases`, Action: runReleases, Subcommands: []cli.Command{ CmdReleaseCreate, }, Flags: AllDefaultFlags, }
CmdReleases represents to login a gitea server.
var CmdRepos = cli.Command{ Name: "repos", Usage: "Operate with repositories", Description: `Operate with repositories`, Action: runReposList, Subcommands: []cli.Command{ CmdReposList, }, Flags: LoginOutputFlags, }
CmdRepos represents to login a gitea server.
var CmdReposList = cli.Command{ Name: "ls", Usage: "List available repositories", Description: `List available repositories`, Action: runReposList, Flags: append([]cli.Flag{ cli.StringFlag{ Name: "mode", Usage: "Filter listed repositories based on mode, optional - fork, mirror, source", }, cli.StringFlag{ Name: "org", Usage: "Filter listed repositories based on organization, optional", }, cli.StringFlag{ Name: "user", Usage: "Filter listed repositories absed on user, optional", }, }, LoginOutputFlags...), }
CmdReposList represents a sub command of issues to list issues
var LoginFlag = cli.StringFlag{
Name: "login, l",
Usage: "Use a different Gitea login. Optional",
Destination: &loginValue,
}
LoginFlag provides flag to specify tea login profile
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
var LoginRepoFlags = []cli.Flag{ LoginFlag, RepoFlag, }
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
var OutputFlag = cli.StringFlag{
Name: "output, o",
Usage: "Output format. (csv, simple, table, tsv, yaml)",
Destination: &outputValue,
}
OutputFlag provides flag to specify output type
var RemoteFlag = cli.StringFlag{
Name: "remote, R",
Usage: "Discover Gitea login from remote. Optional",
Destination: &remoteValue,
}
RemoteFlag provides flag to specify remote repository
var RepoFlag = cli.StringFlag{
Name: "repo, r",
Usage: "Repository to interact with. Optional",
Destination: &repoValue,
}
RepoFlag provides flag to specify repository
Functions ¶
func Errorf ¶
func Errorf(format string, a ...interface{})
Errorf printf content as an error information
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