editor

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package editor is an interactive command-line editor that supports sub-commands with arguments.

Index

Constants

This section is empty.

Variables

View Source
var ErrCommandNotFound = errors.New("command not found")
View Source
var ErrExitEditor = errors.New("exit editor")

Functions

This section is empty.

Types

type Command

type Command interface {
	// contains filtered or unexported methods
}

func NewCommand

func NewCommand(shortName, description string, args []string, handler func(args []string) error) Command

type Editor

type Editor struct {
	*cli.Prompter
	// contains filtered or unexported fields
}

An Editor handles simple subcommand abstraction.

Note that this structure is not intended to be modified after creation. This removes the need for any kind of synchronization.

func New

func New(prompt *cli.Prompter, helpText string, commands ...Command) *Editor

func (*Editor) Loop

func (e *Editor) Loop()

Jump to

Keyboard shortcuts

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