prompt

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: CC0-1.0 Imports: 7 Imported by: 0

Documentation

Overview

Package rwi : Reader/Writer Interface for command-line

These codes are licensed under CC0. http://creativecommons.org/publicdomain/zero/1.0/

Package rwi : Reader/Writer Interface for command-line

These codes are licensed under CC0. http://creativecommons.org/publicdomain/zero/1.0/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Errno added in v0.9.2

type Errno int

Errno is error number for CVSS

const (
	ErrTerminate Errno = iota + 1
	ErrNotTerminal
)

func (Errno) Error added in v0.9.2

func (n Errno) Error() string

type OptFunc

type OptFunc func(*Prompt)

OptFunc is self-referential function for functional options pattern

func WithHeaderMessage

func WithHeaderMessage(s string) OptFunc

WithHeaderMessage returns function for setting Reader

func WithPromptString

func WithPromptString(s string) OptFunc

WithPromptString returns function for setting Reader

type Prompt

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

Prompt is a class for interactive mode in CUI shell

func New

func New(rw *rwi.RWI, function func(string) (string, error), opts ...OptFunc) *Prompt

New returns new Prompt instance

func (*Prompt) IsTerminal

func (p *Prompt) IsTerminal() bool

IsTerminal returns true if running in terminal

func (*Prompt) Once added in v0.9.1

func (p *Prompt) Once() error

Once function starts interactive mode (one round).

func (*Prompt) Run

func (p *Prompt) Run() error

Run function starts interactive mode.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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