docs(collaborator): 子命令描述和注释中文化

This commit is contained in:
刘焱 2026-06-08 19:56:25 +08:00
parent 5c9e24c725
commit be152b9fa1
2 changed files with 17 additions and 7 deletions

View File

@ -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

View File

@ -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(),
)
}