helper

package
v0.6.0-RC2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const DetachedFlag = "detached"
View Source
const DetachedShortFlag = "d"
View Source
const LinuxManPath = "/usr/share/man/man1/"

Variables

This section is empty.

Functions

func Detached

func Detached()

Detached launch command in background

func PrintTable

func PrintTable(cols []string, nbRows int, getRow func(int) []string)

func QuitToStdErr

func QuitToStdErr(msg interface{})

QuitToStdErr prints an error on stderr and closes

func QuitWithUserError

func QuitWithUserError(err error)

QuitWithUserError ...

func ReadFromTerminalYN

func ReadFromTerminalYN(def string) (selected string, err error)

ReadFromTerminalYN read terminal user input from a Yes No dialog. It returns y and n only with an explicit Yy or Nn input. If no input is submitted it returns default value. If the input is different from the expected one empty string is returned.

func UsageSprintf

func UsageSprintf(usages map[string][]string) string

Types

type Options

type Options struct {
	CfgFn string
}

Options cmd options

func (*Options) InitConfig

func (o *Options) InitConfig(name string)

InitConfig initializes config

type PasswordReader

type PasswordReader interface {
	Read(string) ([]byte, error)
}
var DefaultPasswordReader PasswordReader = new(stdinPasswordReader)

type RequiredArgs

type RequiredArgs struct {
	Cmd    string
	Usage  string
	Usages map[string][]string
}

func (*RequiredArgs) Require

func (ra *RequiredArgs) Require(args []string, argPos int, argName string, action string) (string, error)

Jump to

Keyboard shortcuts

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