gitlink-cli/shortcuts/util/util.go

44 lines
1009 B
Go

package util
import (
"github.com/gitlink-org/gitlink-cli/shortcuts/common"
)
func Shortcuts() []*common.Shortcut {
return []*common.Shortcut{
{
Name: "licenses",
Description: "List available open source license templates",
Run: func(ctx *common.RuntimeContext) error {
env, err := ctx.CallAPI("GET", "/licenses", nil)
if err != nil {
return err
}
return ctx.Output(env)
},
},
{
Name: "ignores",
Description: "List available .gitignore templates",
Run: func(ctx *common.RuntimeContext) error {
env, err := ctx.CallAPI("GET", "/ignores", nil)
if err != nil {
return err
}
return ctx.Output(env)
},
},
{
Name: "platform-msg-settings",
Description: "Show platform-wide message notification settings",
Run: func(ctx *common.RuntimeContext) error {
env, err := ctx.CallAPI("GET", "/template_message_settings", nil)
if err != nil {
return err
}
return ctx.Output(env)
},
},
}
}