cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear()

func Question

func Question(question string, options QuestionOptions) (string, error)

func SelectMenu

func SelectMenu(question string, options []string) (int, error)

Types

type CliColor

type CliColor string
const (
	COLOR_RESET CliColor = "\u001b[0m"

	COLOR_BLACK   CliColor = "\u001b[30m"
	COLOR_RED     CliColor = "\u001b[31m"
	COLOR_GREEN   CliColor = "\u001b[32m"
	COLOR_YELLOW  CliColor = "\u001b[33m"
	COLOR_BLUE    CliColor = "\u001b[34m"
	COLOR_MAGENTA CliColor = "\u001b[35m"
	COLOR_CYAN    CliColor = "\u001b[36m"
	COLOR_WHITE   CliColor = "\u001b[37m"

	COLOR_BRIGHT_BLACK   CliColor = "\u001b[30;1m"
	COLOR_BRIGHT_RED     CliColor = "\u001b[31;1m"
	COLOR_BRIGHT_GREEN   CliColor = "\u001b[32;1m"
	COLOR_BRIGHT_YELLOW  CliColor = "\u001b[33;1m"
	COLOR_BRIGHT_BLUE    CliColor = "\u001b[34;1m"
	COLOR_BRIGHT_MAGENTA CliColor = "\u001b[35;1m"
	COLOR_BRIGHT_CYAN    CliColor = "\u001b[36;1m"
	COLOR_BRIGHT_WHITE   CliColor = "\u001b[37;1m"

	COLOR_BACKGROUND_BLACK   CliColor = "\u001b[40m"
	COLOR_BACKGROUND_RED     CliColor = "\u001b[41m"
	COLOR_BACKGROUND_GREEN   CliColor = "\u001b[42m"
	COLOR_BACKGROUND_YELLOW  CliColor = "\u001b[43m"
	COLOR_BACKGROUND_BLUE    CliColor = "\u001b[44m"
	COLOR_BACKGROUND_MAGENTA CliColor = "\u001b[45m"
	COLOR_BACKGROUND_CYAN    CliColor = "\u001b[46m"
	COLOR_BACKGROUND_WHITE   CliColor = "\u001b[47m"

	COLOR_BRIGHT_BACKGROUND_BLACK   CliColor = "\u001b[40;1m"
	COLOR_BRIGHT_BACKGROUND_RED     CliColor = "\u001b[41;1m"
	COLOR_BRIGHT_BACKGROUND_GREEN   CliColor = "\u001b[42;1m"
	COLOR_BRIGHT_BACKGROUND_YELLOW  CliColor = "\u001b[43;1m"
	COLOR_BRIGHT_BACKGROUND_BLUE    CliColor = "\u001b[44;1m"
	COLOR_BRIGHT_BACKGROUND_MAGENTA CliColor = "\u001b[45;1m"
	COLOR_BRIGHT_BACKGROUND_CYAN    CliColor = "\u001b[46;1m"
	COLOR_BRIGHT_BACKGROUND_WHITE   CliColor = "\u001b[47;1m"

	COLOR_BOLD      CliColor = "\u001b[1m"
	COLOR_UNDERLINE CliColor = "\u001b[4m"
	COLOR_REVERSED  CliColor = "\u001b[7m"
)

type QuestionOptions

type QuestionOptions struct {
	Normalize bool
	Accepts   []string
	Fallback  string
}

Jump to

Keyboard shortcuts

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