cli

package
v0.0.0-...-e555f51 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

This 'cli' package contains small command library. It define 'Command' interface with one method which each command needs to implement. It provides framework 'Commander' with which one can register all commands. 'Commander' also takes care of executing the command.

This package should not use other package from this project. This package itself as small lib in this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Execute(ctx context.Context, args []string) error
}

type Commander

type Commander struct {
	// contains filtered or unexported fields
}

func NewCommander

func NewCommander(helpCmd Command, defaultCmd Command) *Commander

func (*Commander) Register

func (c *Commander) Register(name string, command Command)

func (*Commander) ServeCommand

func (c *Commander) ServeCommand(args []string) error

Jump to

Keyboard shortcuts

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