lxd: github.com/lxc/lxd/shared/cmd Index | Files

package cmd

import "github.com/lxc/lxd/shared/cmd"

Index

Package Files

ask.go format.go

func AskBool Uses

func AskBool(question string, defaultAnswer string) bool

AskBool asks a question and expect a yes/no answer.

func AskChoice Uses

func AskChoice(question string, choices []string, defaultAnswer string) string

AskChoice asks the user to select one of multiple options

func AskInt Uses

func AskInt(question string, min int64, max int64, defaultAnswer string) int64

AskInt asks the user to enter an integer between a min and max value

func AskPassword Uses

func AskPassword(question string) string

AskPassword asks the user to enter a password.

func AskPasswordOnce Uses

func AskPasswordOnce(question string) string

AskPasswordOnce asks the user to enter a password.

It's the same as AskPassword, but it won't ask to enter it again.

func AskString Uses

func AskString(question string, defaultAnswer string, validate func(string) error) string

AskString asks the user to enter a string, which optionally conforms to a validation function.

func FormatSection Uses

func FormatSection(header string, content string) string

FormatSection properly indents a text section

Package cmd imports 7 packages (graph) and is imported by 13 packages. Updated 2018-04-08. Refresh now. Tools for package owners.