Command

package
v0.0.0-...-3e87f45 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

* @Author: NyanCatda * @Date: 2022-03-30 19:57:58 * @LastEditTime: 2022-04-04 12:28:51 * @LastEditors: NyanCatda * @Description: 命令处理 * @FilePath: \Momizi\Tools\Terminal\Command\Command.go

* @Author: NyanCatda * @Date: 2022-04-02 22:17:05 * @LastEditTime: 2022-04-02 23:24:13 * @LastEditors: NyanCatda * @Description: 退出命令 * @FilePath: \Momizi\Tools\Terminal\Command\Exit.go

* @Author: NyanCatda * @Date: 2022-04-02 22:18:50 * @LastEditTime: 2022-04-03 13:12:09 * @LastEditors: NyanCatda * @Description: 帮助命令 * @FilePath: \Momizi\Tools\Terminal\Command\Help.go

* @Author: NyanCatda * @Date: 2022-04-04 12:14:09 * @LastEditTime: 2022-04-04 12:42:36 * @LastEditors: NyanCatda * @Description: 插件操作命令 * @FilePath: \Momizi\Tools\Terminal\Command\Plugin.go

Index

Constants

This section is empty.

Variables

View Source
var CommandList []CommandInfo

Functions

func AddCommand

func AddCommand(Command string, Help string, Callback CommandFunc)

*

  • @description: 添加命令
  • @param {string} Command 命令
  • @param {string} Help 帮助信息
  • @param {CommandFunc} Callback 回调函数
  • @return {*}

func Command

func Command(CommandStr string) error

*

  • @description: 命令处理
  • @param {string} commandStr
  • @return {*}

func Exit

func Exit(CommandParameters []string)

*

  • @description: 退出命令
  • @param {[]string} CommandParameters 命令参数
  • @return {*}

func Help

func Help(CommandParameters []string)

*

  • @description: 帮助命令
  • @param {[]string} CommandParameters 命令参数
  • @return {*}

func InitCommandList

func InitCommandList()

*

  • @description: 初始化默认命令列表
  • @param {*}
  • @return {*}

func Plugin

func Plugin(CommandParameters []string)

*

  • @description: 插件操作命令
  • @param {[]string} CommandParameters 命令参数
  • @return {*}

Types

type CommandFunc

type CommandFunc func([]string)

type CommandInfo

type CommandInfo struct {
	Command  string
	Help     string
	Callback CommandFunc
}

Jump to

Keyboard shortcuts

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