Proper help text & new README structure #311
11
cmd/categories.go
Normal file
11
cmd/categories.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cmd
|
||||
|
||||
var (
|
||||
catSetup = "SETUP"
|
||||
catEntities = "ENTITIES"
|
||||
catHelpers = "HELPERS"
|
||||
)
|
|
@ -18,6 +18,7 @@ import (
|
|||
var CmdIssues = cli.Command{
|
||||
Name: "issues",
|
||||
Aliases: []string{"issue"},
|
||||
Category: catEntities,
|
||||
Usage: "List, create and update issues",
|
||||
Description: "List, create and update issues",
|
||||
ArgsUsage: "[<issue index>]",
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
var CmdLabels = cli.Command{
|
||||
Name: "labels",
|
||||
Aliases: []string{"label"},
|
||||
Category: catEntities,
|
||||
Usage: "Manage issue labels",
|
||||
Description: `Manage issue labels`,
|
||||
Action: runLabels,
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
var CmdLogin = cli.Command{
|
||||
Name: "logins",
|
||||
Aliases: []string{"login"},
|
||||
Category: catSetup,
|
||||
Usage: "Log in to a Gitea server",
|
||||
Description: `Log in to a Gitea server`,
|
||||
ArgsUsage: "[<login name>]",
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
// CmdLogout represents to logout a gitea server.
|
||||
var CmdLogout = cli.Command{
|
||||
Name: "logout",
|
||||
Category: catSetup,
|
||||
Usage: "Log out from a Gitea server",
|
||||
Description: `Log out from a Gitea server`,
|
||||
ArgsUsage: "<login name>",
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
var CmdMilestones = cli.Command{
|
||||
Name: "milestones",
|
||||
Aliases: []string{"milestone", "ms"},
|
||||
Category: catEntities,
|
||||
Usage: "List and create milestones",
|
||||
Description: `List and create milestones`,
|
||||
ArgsUsage: "[<milestone name>]",
|
||||
|
|
|
@ -19,6 +19,7 @@ import (
|
|||
var CmdNotifications = cli.Command{
|
||||
Name: "notifications",
|
||||
Aliases: []string{"notification", "notif"},
|
||||
Category: catHelpers,
|
||||
Usage: "Show notifications",
|
||||
Description: "Show notifications, by default based of the current repo and unread one",
|
||||
Action: runNotifications,
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
// CmdOpen represents a sub command of issues to open issue on the web browser
|
||||
var CmdOpen = cli.Command{
|
||||
Name: "open",
|
||||
Category: catHelpers,
|
||||
Usage: "Open something of the repository on web browser",
|
||||
Description: `Open something of the repository on web browser`,
|
||||
Action: runOpen,
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
var CmdOrgs = cli.Command{
|
||||
Name: "organizations",
|
||||
Aliases: []string{"organization", "org"},
|
||||
Category: catEntities,
|
||||
Usage: "List, create, delete organizations",
|
||||
Description: "Show organization details",
|
||||
ArgsUsage: "[<organization>]",
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
var CmdPulls = cli.Command{
|
||||
Name: "pulls",
|
||||
Aliases: []string{"pull", "pr"},
|
||||
Category: catEntities,
|
||||
Usage: "List, create, checkout and clean pull requests",
|
||||
Description: `List, create, checkout and clean pull requests`,
|
||||
ArgsUsage: "[<pull index>]",
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
var CmdReleases = cli.Command{
|
||||
Name: "releases",
|
||||
Aliases: []string{"release"},
|
||||
Category: catEntities,
|
||||
Usage: "Manage releases",
|
||||
Description: "Manage releases",
|
||||
Action: releases.RunReleasesList,
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
var CmdRepos = cli.Command{
|
||||
Name: "repos",
|
||||
Aliases: []string{"repo"},
|
||||
Category: catEntities,
|
||||
Usage: "Show repository details",
|
||||
Description: "Show repository details",
|
||||
ArgsUsage: "[<repo owner>/<repo name>]",
|
||||
|
|
|
@ -11,9 +11,10 @@ import (
|
|||
|
||||
// CmdTrackedTimes represents the command to operate repositories' times.
|
||||
var CmdTrackedTimes = cli.Command{
|
||||
Name: "times",
|
||||
Aliases: []string{"time"},
|
||||
Usage: "Operate on tracked times of a repository's issues & pulls",
|
||||
Name: "times",
|
||||
Aliases: []string{"time"},
|
||||
Category: catEntities,
|
||||
Usage: "Operate on tracked times of a repository's issues & pulls",
|
||||
Description: `Operate on tracked times of a repository's issues & pulls.
|
||||
Depending on your permissions on the repository, only your own tracked
|
||||
times might be listed.`,
|
||||
|
|
10
main.go
10
main.go
|
@ -35,16 +35,18 @@ func main() {
|
|||
app.Commands = []*cli.Command{
|
||||
&cmd.CmdLogin,
|
||||
&cmd.CmdLogout,
|
||||
|
||||
&cmd.CmdIssues,
|
||||
&cmd.CmdPulls,
|
||||
&cmd.CmdReleases,
|
||||
&cmd.CmdRepos,
|
||||
&cmd.CmdLabels,
|
||||
&cmd.CmdMilestones,
|
||||
&cmd.CmdReleases,
|
||||
&cmd.CmdTrackedTimes,
|
||||
&cmd.CmdOrgs,
|
||||
&cmd.CmdRepos,
|
||||
|
||||
&cmd.CmdOpen,
|
||||
&cmd.CmdNotifications,
|
||||
&cmd.CmdMilestones,
|
||||
&cmd.CmdOrgs,
|
||||
}
|
||||
app.EnableBashCompletion = true
|
||||
err := app.Run(os.Args)
|
||||
|
|
Loading…
Reference in New Issue
Block a user