cli

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// InfoType defines the info type color.
	InfoType ergo.MessageLevel = "blue"
	// WarningType defines the warning color.
	WarningType ergo.MessageLevel = "yellow"
	// ErrorType defines the error color.
	ErrorType ergo.MessageLevel = "red"
	// SuccessType defines the success color.
	SuccessType ergo.MessageLevel = "green"
)

Functions

This section is empty.

Types

type CLI

type CLI struct {
}

CLI struct prints the message to console.

func NewCLI

func NewCLI() *CLI

NewCLI initialize and return an new CLI object.

func (CLI) Confirmation

func (c CLI) Confirmation(actionText, cancellationMessage, successMessage string) (bool, error)

Confirmation will return true if user press ok otherwise will return false.

func (CLI) Input

func (CLI) Input() (string, error)

Input reads a line from standard input and returns it.

func (CLI) PrintColorizedLine

func (CLI) PrintColorizedLine(title, content string, level ergo.MessageLevel)

PrintColorizedLine print a colorized line.

func (CLI) PrintLine

func (CLI) PrintLine(content ...interface{})

PrintLine print a line.

func (CLI) PrintTable

func (CLI) PrintTable(header []string, values [][]string)

PrintTable is responsible to print a table view to terminal.

Jump to

Keyboard shortcuts

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