cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cli provides all methods to control command line functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Readline

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

Readline structure

func Init

func Init(prompt string) *Readline

Init set readline imain items

func (*Readline) AddCompleter

func (r *Readline) AddCompleter(pcItem string, pcSubItems []string)

AddCompleter updates subitem(s) from a specific main item

func (*Readline) Close

func (r *Readline) Close(next chan struct{})

Close the readline instance

func (*Readline) GetPrompt

func (r *Readline) GetPrompt() string

GetPrompt returns the current prompt string

func (*Readline) Help

func (r *Readline) Help()

Help print out the main help

func (*Readline) Next

func (r *Readline) Next()

Next trigers to read next line

func (*Readline) Refresh

func (r *Readline) Refresh()

Refresh prompt

func (*Readline) RemoveItemCompleter

func (r *Readline) RemoveItemCompleter(pcItem string)

RemoveItemCompleter removes subitem(s) from a specific main item

func (*Readline) Run

func (r *Readline) Run(cmd chan<- string, next chan struct{})

Run the main loop

func (*Readline) SetEmacs

func (r *Readline) SetEmacs()

SetEmacs set mode to emacs

func (*Readline) SetPrompt

func (r *Readline) SetPrompt(p string)

SetPrompt set readline prompt and store it

func (*Readline) SetVim

func (r *Readline) SetVim()

SetVim set mode to vim

func (*Readline) UpdateCompleter

func (r *Readline) UpdateCompleter(pcItem string, pcSubItems []string)

UpdateCompleter updates subitem(s) from a specific main item

func (*Readline) UpdatePromptN

func (r *Readline) UpdatePromptN(p string, n int)

UpdatePromptN appends readline prompt

Jump to

Keyboard shortcuts

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