proxy.golang.org : github.com/trzsz/promptui
Package promptui is a library providing a simple interface to create command-line prompts for go. It can be easily integrated into spf13/cobra, urfave/cli or any cli go application. promptui has two main input modes: Prompt provides a single line for user input. It supports optional live validation, confirmation and masking the input. Select provides a list of options to choose from. It supports pagination, search, detailed view and custom templates. Package promptui implements a write filter (tabwriter.Writer) that translates tabbed columns in input into properly aligned text. The package is using the Elastic Tabstops algorithm described at http://nickgravgaard.com/elastictabstops/index.html. The text/tabwriter package is frozen and is not accepting new features. This is an example for the Prompt mode of promptui. In this example, a prompt is created with a validator function that validates the given value to make sure its a number. If successful, it will output the chosen number in a formatted message. This is an example for the Select mode of promptui. In this example, a select is created with the days of the week as its items. When an item is selected, the selected day will be displayed in a formatted message.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/trzsz/promptui
License: BSD-3-Clause
Latest release: 9 months ago
First release: over 7 years ago
Namespace: github.com/trzsz
Dependent packages: 2
Stars: 0 on GitHub
Forks: 0 on GitHub
Docker dependents: 1
Docker downloads: 309
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/trzsz
Last synced: 5 days ago