forked from Gitlink/gitlink-cli
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
package util
|
||
|
||
import (
|
||
"github.com/gitlink-org/gitlink-cli/shortcuts/common"
|
||
)
|
||
|
||
func Shortcuts() []*common.Shortcut {
|
||
return []*common.Shortcut{
|
||
// +licenses:列出可用的开源许可证模板
|
||
{
|
||
Name: "licenses",
|
||
Description: "列出可用的开源许可证模板",
|
||
Run: func(ctx *common.RuntimeContext) error {
|
||
env, err := ctx.CallAPI("GET", "/licenses", nil)
|
||
if err != nil {
|
||
return err
|
||
}
|
||
return ctx.Output(env)
|
||
},
|
||
},
|
||
// +ignores:列出可用的 .gitignore 模板
|
||
{
|
||
Name: "ignores",
|
||
Description: "列出可用的 .gitignore 模板",
|
||
Run: func(ctx *common.RuntimeContext) error {
|
||
env, err := ctx.CallAPI("GET", "/ignores", nil)
|
||
if err != nil {
|
||
return err
|
||
}
|
||
return ctx.Output(env)
|
||
},
|
||
},
|
||
// +platform-msg-settings:查看平台消息通知设置
|
||
{
|
||
Name: "platform-msg-settings",
|
||
Description: "查看平台消息通知设置",
|
||
Run: func(ctx *common.RuntimeContext) error {
|
||
env, err := ctx.CallAPI("GET", "/template_message_settings", nil)
|
||
if err != nil {
|
||
return err
|
||
}
|
||
return ctx.Output(env)
|
||
},
|
||
},
|
||
}
|
||
}
|