command

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands = map[string]Command{}

Functions

func InvokeCommand

func InvokeCommand(input string) (found bool, out string)

func RegisterCommand

func RegisterCommand(command Command)

func RegisterCommands

func RegisterCommands(commands ...Command)

Types

type Command

type Command struct {
	Name, Description string
	Aliases           []string
	Handle            CommandHandler
}

type CommandHandler

type CommandHandler func(input string) string

Jump to

Keyboard shortcuts

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