From 782a6318f3038cc7466cf908ab1d11ce70565925 Mon Sep 17 00:00:00 2001 From: Norwin Date: Thu, 17 Dec 2020 00:47:40 +0800 Subject: [PATCH] Add more command shorthands (#307) add more command aliases breaking: s/notif/n Co-authored-by: Norwin Roosen Reviewed-on: https://gitea.com/gitea/tea/pulls/307 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Lunny Xiao Co-Authored-By: Norwin Co-Committed-By: Norwin --- cmd/issues.go | 2 +- cmd/issues/create.go | 1 + cmd/issues/list.go | 4 ++-- cmd/labels/create.go | 1 + cmd/labels/delete.go | 1 + cmd/labels/list.go | 4 ++-- cmd/login/edit.go | 1 + cmd/login/list.go | 4 ++-- cmd/milestones/create.go | 1 + cmd/milestones/list.go | 4 ++-- cmd/notifications.go | 2 +- cmd/open.go | 5 +++-- cmd/organizations/list.go | 4 ++-- cmd/pulls/checkout.go | 1 + cmd/pulls/create.go | 1 + cmd/pulls/list.go | 4 ++-- cmd/releases.go | 2 +- cmd/releases/create.go | 1 + cmd/releases/delete.go | 1 + cmd/releases/edit.go | 1 + cmd/releases/list.go | 4 ++-- cmd/repos/list.go | 4 ++-- cmd/times.go | 2 +- cmd/times/add.go | 1 + cmd/times/list.go | 4 ++-- 25 files changed, 36 insertions(+), 24 deletions(-) diff --git a/cmd/issues.go b/cmd/issues.go index fd78eb0..7febb0b 100644 --- a/cmd/issues.go +++ b/cmd/issues.go @@ -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: "[]", diff --git a/cmd/issues/create.go b/cmd/issues/create.go index fb535d3..f46031a 100644 --- a/cmd/issues/create.go +++ b/cmd/issues/create.go @@ -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, diff --git a/cmd/issues/list.go b/cmd/issues/list.go index 1a722fe..b2b17bf 100644 --- a/cmd/issues/list.go +++ b/cmd/issues/list.go @@ -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, diff --git a/cmd/labels/create.go b/cmd/labels/create.go index 4f9773d..c4fcf38 100644 --- a/cmd/labels/create.go +++ b/cmd/labels/create.go @@ -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, diff --git a/cmd/labels/delete.go b/cmd/labels/delete.go index 0e32e9d..cc193a7 100644 --- a/cmd/labels/delete.go +++ b/cmd/labels/delete.go @@ -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, diff --git a/cmd/labels/list.go b/cmd/labels/list.go index f4b8c62..6d2790f 100644 --- a/cmd/labels/list.go +++ b/cmd/labels/list.go @@ -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, diff --git a/cmd/login/edit.go b/cmd/login/edit.go index 0f06a5d..cc56f5d 100644 --- a/cmd/login/edit.go +++ b/cmd/login/edit.go @@ -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, diff --git a/cmd/login/list.go b/cmd/login/list.go index f30fec0..99d8c7e 100644 --- a/cmd/login/list.go +++ b/cmd/login/list.go @@ -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, diff --git a/cmd/milestones/create.go b/cmd/milestones/create.go index 11e6bd7..7d8c89d 100644 --- a/cmd/milestones/create.go +++ b/cmd/milestones/create.go @@ -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, diff --git a/cmd/milestones/list.go b/cmd/milestones/list.go index 9b168f6..bf54e8c 100644 --- a/cmd/milestones/list.go +++ b/cmd/milestones/list.go @@ -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, diff --git a/cmd/notifications.go b/cmd/notifications.go index ad4f104..3cab988 100644 --- a/cmd/notifications.go +++ b/cmd/notifications.go @@ -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, diff --git a/cmd/open.go b/cmd/open.go index 31f8006..9868bc1 100644 --- a/cmd/open.go +++ b/cmd/open.go @@ -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...), } diff --git a/cmd/organizations/list.go b/cmd/organizations/list.go index 6b63706..bc5219e 100644 --- a/cmd/organizations/list.go +++ b/cmd/organizations/list.go @@ -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, diff --git a/cmd/pulls/checkout.go b/cmd/pulls/checkout.go index 4ca9bf9..4008cb0 100644 --- a/cmd/pulls/checkout.go +++ b/cmd/pulls/checkout.go @@ -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, diff --git a/cmd/pulls/create.go b/cmd/pulls/create.go index e52290a..dd27cf8 100644 --- a/cmd/pulls/create.go +++ b/cmd/pulls/create.go @@ -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, diff --git a/cmd/pulls/list.go b/cmd/pulls/list.go index 55d4476..5037b48 100644 --- a/cmd/pulls/list.go +++ b/cmd/pulls/list.go @@ -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, diff --git a/cmd/releases.go b/cmd/releases.go index 7084173..4a6792e 100644 --- a/cmd/releases.go +++ b/cmd/releases.go @@ -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, diff --git a/cmd/releases/create.go b/cmd/releases/create.go index f496cda..ef203f3 100644 --- a/cmd/releases/create.go +++ b/cmd/releases/create.go @@ -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, diff --git a/cmd/releases/delete.go b/cmd/releases/delete.go index 9f89199..e9ba55c 100644 --- a/cmd/releases/delete.go +++ b/cmd/releases/delete.go @@ -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: "", diff --git a/cmd/releases/edit.go b/cmd/releases/edit.go index 635c6bc..8cc0bfa 100644 --- a/cmd/releases/edit.go +++ b/cmd/releases/edit.go @@ -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: "", diff --git a/cmd/releases/list.go b/cmd/releases/list.go index 3b43d48..5302707 100644 --- a/cmd/releases/list.go +++ b/cmd/releases/list.go @@ -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, diff --git a/cmd/repos/list.go b/cmd/repos/list.go index 79cbefc..d2e6511 100644 --- a/cmd/repos/list.go +++ b/cmd/repos/list.go @@ -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, diff --git a/cmd/times.go b/cmd/times.go index 1326b40..0a010f6 100644 --- a/cmd/times.go +++ b/cmd/times.go @@ -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 diff --git a/cmd/times/add.go b/cmd/times/add.go index 928e65f..3ea9b0a 100644 --- a/cmd/times/add.go +++ b/cmd/times/add.go @@ -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 ", Description: `Track spent time on an issue diff --git a/cmd/times/list.go b/cmd/times/list.go index 4a3f4a1..e89e855 100644 --- a/cmd/times/list.go +++ b/cmd/times/list.go @@ -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.