cliutils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlattenPkgs

func FlattenPkgs(found map[string][]db.Package, verb string, t translate.Translator) []db.Package

FlattenPkgs attempts to flatten the a map of slices of packages into a single slice of packages by prompting the user if multiple packages match.

func PkgPrompt

func PkgPrompt(options []db.Package, verb string, t translate.Translator) ([]db.Package, error)

PkgPrompt asks the user to choose between multiple packages. The user may choose multiple packages.

func PromptViewScript

func PromptViewScript(script, name, style string, t translate.Translator) error

PromptViewScript asks the user if they'd like to see a script, shows it if they answer yes, then asks if they'd still like to continue, and exits if they answer no.

func ShowScript

func ShowScript(path, name, style string) error

ShowScript uses the built-in pager to display a script at a given path, in the given syntax highlighting style.

func YesNoPrompt

func YesNoPrompt(msg string, def bool, t translate.Translator) (bool, error)

YesNoPrompt asks the user a yes or no question, using def as the default answer

Types

This section is empty.

Jump to

Keyboard shortcuts

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