prompt

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prompt

type Prompt struct {
	Page      *pages.Page
	Questions []*survey.Question
}

Prompt struct is responsible for maintaining the life cycle of a tldr man page

func New

func New(p *pages.Page) *Prompt

New creates a new *prompt.Prompt obj. from a tldr Page

func (*Prompt) GenerateCommand

func (p *Prompt) GenerateCommand(t *pages.Tip) (string, error)

GenerateCommand generates command form *pages.Tip

func (*Prompt) RenderPage

func (p *Prompt) RenderPage(static bool) error

RenderPage prints the tldr man page as is

func (*Prompt) Run

func (p *Prompt) Run(command string) error

Run gets final confirmation from user and executes the command with its args

func (*Prompt) Selection

func (p *Prompt) Selection() (t *pages.Tip, err error)

Selection is where user interaction starts, hence we can *pages.Tip to iterate user interaction

Jump to

Keyboard shortcuts

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