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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ import (
// CmdTrackedTimes represents the command to operate repositories' times. // CmdTrackedTimes represents the command to operate repositories' times.
var CmdTrackedTimes = cli.Command{ var CmdTrackedTimes = cli.Command{
Name: "times", Name: "times",
Aliases: []string{"time"}, Aliases: []string{"time", "t"},
Usage: "Operate on tracked times of a repository's issues & pulls", Usage: "Operate on tracked times of a repository's issues & pulls",
Description: `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 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 // CmdTrackedTimesAdd represents a sub command of times to add time to an issue
var CmdTrackedTimesAdd = cli.Command{ var CmdTrackedTimesAdd = cli.Command{
Name: "add", Name: "add",
Aliases: []string{"a"},
Usage: "Track spent time on an issue", Usage: "Track spent time on an issue",
UsageText: "tea times add <issue> <duration>", UsageText: "tea times add <issue> <duration>",
Description: `Track spent time on an issue Description: `Track spent time on an issue

View File

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