From be152b9fa15513845e6b8f827f6ac73f08e8bb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=84=B1?= <1877685089@qq.com> Date: Mon, 8 Jun 2026 19:56:25 +0800 Subject: [PATCH] =?UTF-8?q?docs(collaborator):=20=E5=AD=90=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E6=8F=8F=E8=BF=B0=E5=92=8C=E6=B3=A8=E9=87=8A=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shortcuts/collaborator/batch.go | 9 ++++++--- shortcuts/collaborator/collaborator.go | 15 +++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/shortcuts/collaborator/batch.go b/shortcuts/collaborator/batch.go index 9846818..b4f3d99 100644 --- a/shortcuts/collaborator/batch.go +++ b/shortcuts/collaborator/batch.go @@ -14,8 +14,9 @@ type userRole struct { func newBatchAddShortcut() *common.Shortcut { return &common.Shortcut{ + // +batch-add:批量添加多名协作者 Name: "batch-add", - Description: "Add multiple collaborators to the repository", + Description: "批量添加多名协作者", Long: `Add multiple collaborators to the repository in a single operation. Provide collaborators via --users (comma-separated usernames) or --from (CSV @@ -49,8 +50,9 @@ Available roles: admin, write, read.`, func newBatchRemoveShortcut() *common.Shortcut { return &common.Shortcut{ + // +batch-remove:批量移除多名协作者 Name: "batch-remove", - Description: "Remove multiple collaborators from the repository", + Description: "批量移除多名协作者", Long: `Remove multiple collaborators from the repository in a single operation. Provide collaborators via --users (comma-separated usernames) or --from (CSV @@ -80,8 +82,9 @@ any changes.`, func newBatchRoleShortcut() *common.Shortcut { return &common.Shortcut{ + // +batch-role:批量修改多名协作者的角色 Name: "batch-role", - Description: "Change role for multiple collaborators", + Description: "批量修改多名协作者的角色", Long: `Change the role of multiple collaborators in a single operation. Provide collaborators via --users (comma-separated usernames) combined with diff --git a/shortcuts/collaborator/collaborator.go b/shortcuts/collaborator/collaborator.go index 7f5a9d7..091bb58 100644 --- a/shortcuts/collaborator/collaborator.go +++ b/shortcuts/collaborator/collaborator.go @@ -8,9 +8,10 @@ import ( func Shortcuts() []*common.Shortcut { return append([]*common.Shortcut{ + // +list:列出仓库的协作者 { Name: "list", - Description: "List repository collaborators", + Description: "列出仓库协作者", Long: `List repository collaborators. Shows all users who have access to the repository along with their @@ -28,9 +29,10 @@ username, role, and permission level.`, return ctx.Output(env) }, }, + // +add:向仓库添加一名协作者 { Name: "add", - Description: "Add a collaborator to the repository", + Description: "添加仓库协作者", Long: `Add a collaborator to the repository. Invites a user to collaborate on the repository with the specified role. @@ -66,9 +68,10 @@ Available roles: admin, write (default), read.`, return ctx.Output(env) }, }, + // +remove:从仓库移除一名协作者 { Name: "remove", - Description: "Remove a collaborator from the repository", + Description: "移除仓库协作者", Long: `Remove a collaborator from the repository. Revokes the user's access to the repository.`, @@ -97,9 +100,10 @@ Revokes the user's access to the repository.`, return ctx.Output(env) }, }, + // +change-role:修改协作者的角色 { Name: "change-role", - Description: "Change a collaborator's role", + Description: "修改协作者角色", Long: `Change a collaborator's role. Updates the permission level of an existing collaborator. @@ -139,8 +143,11 @@ Available roles: admin, write, read.`, }, }, }, + // +batch-add:批量添加多名协作者 newBatchAddShortcut(), + // +batch-remove:批量移除多名协作者 newBatchRemoveShortcut(), + // +batch-role:批量修改多名协作者的角色 newBatchRoleShortcut(), ) }