cmdrplugin

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 0 Imported by: 2

README

cmdr-base

The basic infrastructures for cmdr.

History

  • v1.0.0: no needs for changing anything so we freeze it and publish as v1 stable.
  • v0.1.3: first release

Documentation

Overview

Package cmdrplugin is a very predecessor for hedzr/cmdr library, which provides the PluginEntry and relevant declarations for cmdr.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginCmd

type PluginCmd interface {
	PluginCompBase
	SubCommands() []PluginCmd
	Flags() []PluginFlag
	Action(args []string) (err error)
}

PluginCmd a command of an addon

type PluginCompBase

type PluginCompBase interface {
	Name() string
	ShortName() string
	Aliases() []string
	Description() string
}

PluginCompBase component for cmd and flag of an addon

type PluginEntry

type PluginEntry interface {
	PluginCmd
	AddonTitle() string
	AddonDescription() string
	AddonCopyright() string
	AddonVersion() string
}

PluginEntry entry of an addon (golang plugin)

type PluginFlag

type PluginFlag interface {
	PluginCompBase
	DefaultValue() interface{}
	PlaceHolder() string
	Action() (err error) // onSet
}

PluginFlag a flag of a command of an addon

Jump to

Keyboard shortcuts

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