gitlink-cli/shortcuts/util/util.go

47 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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