ctx

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SAVE = "save"
	LOAD = "load"
	RICH = "rich"
	GROW = "grow"
)
View Source
const COMMAND = "command"
View Source
const CONFIG = "config"
View Source
const CONTEXT = "context"

Variables

View Source
var Index = &ice.Context{Name: "ctx", Help: "配置模块",
	Commands: map[string]*ice.Command{
		CONTEXT: {Name: "context [all] [name [command|config arg...]]", Help: "模块", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
			if all, arg := _parse_arg_all(m, arg...); len(arg) == 0 {
				_context_list(m, all)
				return
			}

			if len(arg) == 1 {
				m.Cmdy(COMMAND, arg[0])
			} else {
				m.Search(arg[0]+".", func(p *ice.Context, s *ice.Context, key string) {
					msg := m.Spawn(s)
					switch arg[1] {
					case COMMAND:
						msg.Cmdy(COMMAND, arg[0], arg[2:])
					case CONFIG:
						msg.Cmdy(CONFIG, arg[2:])
					}
					m.Copy(msg)
				})
			}
		}},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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