cli

package
v0.0.0-...-92b8e37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Complete

func Complete(d prompt.Document, adv advisor.Advisor, args []string) (suggestions []prompt.Suggest)

Complete 递归解析Advisor的语法树结构,进行提示,O(n)

func Completer

func Completer(d prompt.Document) []prompt.Suggest

Completer go-prompt的提示接口

func Exec

func Exec()

func Exit

func Exit(code int)

func FindHandler

func FindHandler(adv advisor.Advisor, args []string) (handler func(argument string))

FindHandler 递归解析Advisor的语法树结构,查找命令的执行函数,O(n)

func FirstLetterUpperCaseLegalSuggesterFunc

func FirstLetterUpperCaseLegalSuggesterFunc() advisor.SuggesterFunc

func InitializeJudgeSuggesterFunc

func InitializeJudgeSuggesterFunc(context *data.Context) advisor.SuggesterFunc

func LegalJudgeSuggesterFunc

func LegalJudgeSuggesterFunc(isLegal func(argument string) bool) advisor.SuggesterFunc

func NewNewSkillContextToCreatSkillArgumentAdapter

func NewNewSkillContextToCreatSkillArgumentAdapter() adapter.Adapter[NewSkillContext, data.CreateSkillArguments]

func PackagePathLegalSuggesterFunc

func PackagePathLegalSuggesterFunc() advisor.SuggesterFunc

func StaticSuggesterFunc

func StaticSuggesterFunc(staticSuggestions ...prompt.Suggest) advisor.SuggesterFunc

Types

type Command

type Command = string
const (
	CommandInitMod        Command = "init"
	CommandNewEntity      Command = "new"
	CommandModifyEntity   Command = "modify"
	CommandDeleteEntity   Command = "delete"
	CommandAddDescription Command = "description"
	CommandList           Command = "list"
	CommandExit           Command = "exit"
)

type EntityType

type EntityType = string
const (
	EntityCharacter EntityType = "character"
	EntitySkill     EntityType = "skill"
	EntityEvent     EntityType = "event"
	EntitySummon    EntityType = "summon"
	EntityCard      EntityType = "card"
	EntityRule      EntityType = "rule"
)

type HandlerFunc

type HandlerFunc func(argument string)

func ExitCliHandler

func ExitCliHandler() HandlerFunc

func InitModHandler

func InitModHandler(ctx *data.Context) HandlerFunc

func NewCharacterHandler

func NewCharacterHandler(ctx *data.Context) HandlerFunc

type InitModContext

type InitModContext struct{}

type NewCardContext

type NewCardContext struct{}

type NewCharacterContext

type NewCharacterContext struct {
	CharacterName string
}

type NewRuleContext

type NewRuleContext struct{}

type NewSkillContext

type NewSkillContext struct {
	CharacterName string
	SkillName     string
	SkillID       uint16
	SkillType     enum.SkillType
}

type NewSkillContextToCreatSkillArgumentAdapter

type NewSkillContextToCreatSkillArgumentAdapter struct{}

func (NewSkillContextToCreatSkillArgumentAdapter) Convert

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL