Add more command shorthands (#307)

add more command aliases

breaking: s/notif/n

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/307
Reviewed-by: 6543 <6543@obermui.de>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
Norwin 2020-12-17 00:47:40 +08:00 committed by 6543
parent a948fd7e10
commit 782a6318f3
25 changed files with 36 additions and 24 deletions

View File

@ -17,7 +17,7 @@ import (
// CmdIssues represents to login a gitea server.
var CmdIssues = cli.Command{
Name: "issues",
Aliases: []string{"issue"},
Aliases: []string{"issue", "i"},
Usage: "List, create and update issues",
Description: "List, create and update issues",
ArgsUsage: "[<issue index>]",

View File

@ -16,6 +16,7 @@ import (
// CmdIssuesCreate represents a sub command of issues to create issue
var CmdIssuesCreate = cli.Command{
Name: "create",
Aliases: []string{"c"},
Usage: "Create an issue on repository",
Description: `Create an issue on repository`,
Action: runIssuesCreate,

View File

@ -15,8 +15,8 @@ import (
// CmdIssuesList represents a sub command of issues to list issues
var CmdIssuesList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List issues of the repository",
Description: `List issues of the repository`,
Action: RunIssuesList,

View File

@ -19,6 +19,7 @@ import (
// CmdLabelCreate represents a sub command of labels to create label.
var CmdLabelCreate = cli.Command{
Name: "create",
Aliases: []string{"c"},
Usage: "Create a label",
Description: `Create a label`,
Action: runLabelCreate,

View File

@ -13,6 +13,7 @@ import (
// CmdLabelDelete represents a sub command of labels to delete label.
var CmdLabelDelete = cli.Command{
Name: "delete",
Aliases: []string{"rm"},
Usage: "Delete a label",
Description: `Delete a label`,
Action: runLabelDelete,

View File

@ -16,8 +16,8 @@ import (
// CmdLabelsList represents a sub command of labels to list labels
var CmdLabelsList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List labels",
Description: "List labels",
Action: RunLabelsList,

View File

@ -15,6 +15,7 @@ import (
// CmdLoginEdit represents to login a gitea server.
var CmdLoginEdit = cli.Command{
Name: "edit",
Aliases: []string{"e"},
Usage: "Edit Gitea logins",
Description: `Edit Gitea logins`,
Action: runLoginEdit,

View File

@ -14,8 +14,8 @@ import (
// CmdLoginList represents to login a gitea server.
var CmdLoginList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List Gitea logins",
Description: `List Gitea logins`,
Action: RunLoginList,

View File

@ -18,6 +18,7 @@ import (
// CmdMilestonesCreate represents a sub command of milestones to create milestone
var CmdMilestonesCreate = cli.Command{
Name: "create",
Aliases: []string{"c"},
Usage: "Create an milestone on repository",
Description: `Create an milestone on repository`,
Action: runMilestonesCreate,

View File

@ -15,8 +15,8 @@ import (
// CmdMilestonesList represents a sub command of milestones to list milestones
var CmdMilestonesList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List milestones of the repository",
Description: `List milestones of the repository`,
Action: RunMilestonesList,

View File

@ -16,7 +16,7 @@ import (
// CmdNotifications is the main command to operate with notifications
var CmdNotifications = cli.Command{
Name: "notifications",
Aliases: []string{"notification", "notif"},
Aliases: []string{"notification", "n"},
Usage: "Show notifications",
Description: "Show notifications, by default based of the current repo and unread one",
Action: runNotifications,

View File

@ -19,8 +19,9 @@ import (
// CmdOpen represents a sub command of issues to open issue on the web browser
var CmdOpen = cli.Command{
Name: "open",
Usage: "Open something of the repository on web browser",
Description: `Open something of the repository on web browser`,
Aliases: []string{"o"},
Usage: "Open something of the repository in web browser",
Description: `Open something of the repository in web browser`,
Action: runOpen,
Flags: append([]cli.Flag{}, flags.LoginRepoFlags...),
}

View File

@ -15,8 +15,8 @@ import (
// CmdOrganizationList represents a sub command of organizations to list users organizations
var CmdOrganizationList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List Organizations",
Description: "List users organizations",
Action: RunOrganizationList,

View File

@ -19,6 +19,7 @@ import (
// CmdPullsCheckout is a command to locally checkout the given PR
var CmdPullsCheckout = cli.Command{
Name: "checkout",
Aliases: []string{"co"},
Usage: "Locally check out the given PR",
Description: `Locally check out the given PR`,
Action: runPullsCheckout,

View File

@ -16,6 +16,7 @@ import (
// CmdPullsCreate creates a pull request
var CmdPullsCreate = cli.Command{
Name: "create",
Aliases: []string{"c"},
Usage: "Create a pull-request",
Description: "Create a pull-request",
Action: runPullsCreate,

View File

@ -15,8 +15,8 @@ import (
// CmdPullsList represents a sub command of issues to list pulls
var CmdPullsList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List pull requests of the repository",
Description: `List pull requests of the repository`,
Action: RunPullsList,

View File

@ -15,7 +15,7 @@ import (
// ToDo: ReleaseDetails
var CmdReleases = cli.Command{
Name: "releases",
Aliases: []string{"release"},
Aliases: []string{"release", "r"},
Usage: "Manage releases",
Description: "Manage releases",
Action: releases.RunReleasesList,

View File

@ -20,6 +20,7 @@ import (
// CmdReleaseCreate represents a sub command of Release to create release
var CmdReleaseCreate = cli.Command{
Name: "create",
Aliases: []string{"c"},
Usage: "Create a release",
Description: `Create a release`,
Action: runReleaseCreate,

View File

@ -16,6 +16,7 @@ import (
// CmdReleaseDelete represents a sub command of Release to delete a release
var CmdReleaseDelete = cli.Command{
Name: "delete",
Aliases: []string{"rm"},
Usage: "Delete a release",
Description: `Delete a release`,
ArgsUsage: "<release tag>",

View File

@ -18,6 +18,7 @@ import (
// CmdReleaseEdit represents a sub command of Release to edit releases
var CmdReleaseEdit = cli.Command{
Name: "edit",
Aliases: []string{"e"},
Usage: "Edit a release",
Description: `Edit a release`,
ArgsUsage: "<release tag>",

View File

@ -17,8 +17,8 @@ import (
// CmdReleaseList represents a sub command of Release to list releases
var CmdReleaseList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List Releases",
Description: "List Releases",
Action: RunReleasesList,

View File

@ -35,8 +35,8 @@ var CmdReposListFlags = append([]cli.Flag{
// CmdReposList represents a sub command of repos to list them
var CmdReposList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Usage: "List repositories you have access to",
Description: "List repositories you have access to",
Action: RunReposList,

View File

@ -12,7 +12,7 @@ import (
// CmdTrackedTimes represents the command to operate repositories' times.
var CmdTrackedTimes = cli.Command{
Name: "times",
Aliases: []string{"time"},
Aliases: []string{"time", "t"},
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

View File

@ -20,6 +20,7 @@ import (
// CmdTrackedTimesAdd represents a sub command of times to add time to an issue
var CmdTrackedTimesAdd = cli.Command{
Name: "add",
Aliases: []string{"a"},
Usage: "Track spent time on an issue",
UsageText: "tea times add <issue> <duration>",
Description: `Track spent time on an issue

View File

@ -21,8 +21,8 @@ import (
// CmdTrackedTimesList represents a sub command of times to list them
var CmdTrackedTimesList = cli.Command{
Name: "ls",
Aliases: []string{"list"},
Name: "list",
Aliases: []string{"ls"},
Action: RunTimesList,
Usage: "Operate on tracked times of a repository's issues & pulls",
Description: `Operate on tracked times of a repository's issues & pulls.