Skip to content

Commit 543668e

Browse files
author
minivera
committed
New doc fixes
1 parent 8500733 commit 543668e

File tree

3 files changed

+3
-29
lines changed

3 files changed

+3
-29
lines changed

example_main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// This is an example for the Prompt mode of promptui. In this example, a prompt is created
1010
// with a validator function that validates the given value to make sure its a number.
1111
// If successful, it will output the chosen number in a formatted message.
12-
func Example() {
12+
func Example_prompt() {
1313
validate := func(input string) error {
1414
_, err := strconv.ParseFloat(input, 64)
1515
if err != nil {
@@ -36,7 +36,7 @@ func Example() {
3636
// This is an example for the Select mode of promptui. In this example, a select is created with
3737
// the days of the week as its items. When an item is selected, the selected day will be displayed
3838
// in a formatted message.
39-
func Example_aux() {
39+
func Example_select() {
4040
prompt := Select{
4141
Label: "Select Day",
4242
Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",

select.go

-26
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,6 @@ const SelectedAdd = -1
2020

2121
// Select represents a list of items used to enable selections, they can be used as search engines, menus
2222
// or as a list of items in a cli based prompt.
23-
//
24-
// Basic Usage
25-
// package main
26-
//
27-
// import (
28-
// "fmt"
29-
//
30-
// "github.com/manifoldco/promptui"
31-
// )
32-
//
33-
// func main() {
34-
// prompt := promptui.Select{
35-
// Label: "Select Day",
36-
// Items: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
37-
// "Saturday", "Sunday"},
38-
// }
39-
//
40-
// _, result, err := prompt.Run()
41-
//
42-
// if err != nil {
43-
// fmt.Printf("Prompt failed %v\n", err)
44-
// return
45-
// }
46-
//
47-
// fmt.Printf("You choose %q\n", result)
48-
// }
4923
type Select struct {
5024
// Label is the text displayed on top of the list to direct input. The IconInitial value "?" will be
5125
// appended automatically to the label so it does not need to be added.

styles_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ var (
1616
// IconBad is the icon used when a bad answer is entered in prompt mode.
1717
IconBad = Styler(FGRed)("x")
1818

19-
// IconBad is the icon used to identify the currently selected item in select mode.
19+
// IconSelect is the icon used to identify the currently selected item in select mode.
2020
IconSelect = Styler(FGBold)(">")
2121
)

0 commit comments

Comments
 (0)