goinp

package
v0.0.0-...-054ed78 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 10 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForBool

func AskForBool(messageToPrint string) (bool, error)

AskForBool ...

func AskForBoolFromReader

func AskForBoolFromReader(messageToPrint string, inputReader io.Reader) (bool, error)

AskForBoolFromReader ...

func AskForBoolFromReaderWithDefaultValue

func AskForBoolFromReaderWithDefaultValue(messageToPrint string, defaultValue bool, inputReader io.Reader) (bool, error)

AskForBoolFromReaderWithDefaultValue ...

func AskForBoolWithDefault

func AskForBoolWithDefault(messageToPrint string, defaultValue bool) (bool, error)

AskForBoolWithDefault ...

func AskForInt

func AskForInt(messageToPrint string) (int64, error)

AskForInt ...

func AskForIntFromReader

func AskForIntFromReader(messageToPrint string, inputReader io.Reader) (int64, error)

AskForIntFromReader ...

func AskForIntFromReaderWithDefault

func AskForIntFromReaderWithDefault(messageToPrint string, defaultValue int, inputReader io.Reader) (int64, error)

AskForIntFromReaderWithDefault ...

func AskForIntWithDeafult

func AskForIntWithDeafult(messageToPrint string, defaultValue int) (int64, error)

AskForIntWithDeafult ...

func AskForOptionalInput

func AskForOptionalInput(defaultValue string, optional bool) (string, error)

AskForOptionalInput will wait for input, and will print clearable default text in case of interactive shell. Accepts empty input in case if optional.

func AskForPath

func AskForPath(messageToPrint string) (string, error)

AskForPath ...

func AskForPathFromReader

func AskForPathFromReader(messageToPrint string, inputReader io.Reader) (string, error)

AskForPathFromReader ...

func AskForPathFromReaderWithDefault

func AskForPathFromReaderWithDefault(messageToPrint, defaultValue string, inputReader io.Reader) (string, error)

AskForPathFromReaderWithDefault asks for a path. The difference between this

and the generic "AskForString..." functions is that this'll
clean up the input. For example, if the user drag-and-drops a file/dir
for the input then the input might include back-slash escapes for
spaces in the path - these will be removed, so the
returned path will be "path/with space" instead of "path/with\ space".

func AskForPathWithDefault

func AskForPathWithDefault(messageToPrint, defaultValue string) (string, error)

AskForPathWithDefault ...

func AskForString

func AskForString(messageToPrint string) (string, error)

AskForString ...

func AskForStringFromReader

func AskForStringFromReader(messageToPrint string, inputReader io.Reader) (string, error)

AskForStringFromReader ...

func AskForStringFromReaderWithDefault

func AskForStringFromReaderWithDefault(messageToPrint, defaultValue string, inputReader io.Reader) (string, error)

AskForStringFromReaderWithDefault ...

func AskForStringWithDefault

func AskForStringWithDefault(messageToPrint, defaultValue string) (string, error)

AskForStringWithDefault ...

func ParseBool

func ParseBool(userInputStr string) (bool, error)

ParseBool ...

func SelectFromStrings

func SelectFromStrings(messageToPrint string, options []string) (string, error)

SelectFromStrings ...

func SelectFromStringsFromReader

func SelectFromStringsFromReader(messageToPrint string, options []string, inputReader io.Reader) (string, error)

SelectFromStringsFromReader ...

func SelectFromStringsFromReaderWithDefault

func SelectFromStringsFromReaderWithDefault(messageToPrint string, defaultValue int, options []string, inputReader io.Reader) (string, error)

SelectFromStringsFromReaderWithDefault ...

func SelectFromStringsWithDefault

func SelectFromStringsWithDefault(messageToPrint string, defaultValue int, options []string) (string, error)

SelectFromStringsWithDefault ...

func WriteToTerminalInputBuffer

func WriteToTerminalInputBuffer(text string) error

WriteToTerminalInputBuffer prints a text to the terminal console which can be used as an input for a question or can be cleared out

Types

This section is empty.

Jump to

Keyboard shortcuts

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