promter

package module
v1.0.1-0...-db2a95e Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 4 Imported by: 0

README

Utils for cobra cli's

Installation

go get github.com/meinto/promter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabelWithDefault

func LabelWithDefault(label, defaultValue string) string

Types

type Promter

type Promter interface {
	YesNo(label string) (index int, selection string, err error)
	YesNoDefault(label, defaultValue string) (index int, selection string, err error)
	Select(label string, options []string) (index int, selection string, err error)
	SelectDefault(label, defaultValue string, options []string) (index int, selection string, err error)
	Text(label string, options ...PromterOptions) (input string, err error)
	TextDefault(label, defaultValue string, options ...PromterOptions) (input string, err error)
	OptionalText(label string, options ...PromterOptions) (input string, err error)
	OptionalTextDefault(label, defaultValue string, options ...PromterOptions) (input string, err error)
	URL(label string, options ...PromterOptions) (url string, err error)
	URLDefault(label, defaultValue string, options ...PromterOptions) (url string, err error)
}

func NewPromter

func NewPromter() Promter

type PromterOptions

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

func MergeOptions

func MergeOptions(options ...PromterOptions) PromterOptions

Directories

Path Synopsis
Package mock_promter is a generated GoMock package.
Package mock_promter is a generated GoMock package.

Jump to

Keyboard shortcuts

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