File tree 5 files changed +15
-16
lines changed 5 files changed +15
-16
lines changed Original file line number Diff line number Diff line change 1
1
package promptui
2
2
3
3
import (
4
- "strconv"
5
4
"fmt"
5
+ "strconv"
6
6
)
7
7
8
8
// This example shows how to use the prompt validator and templates to create a stylized prompt.
@@ -39,4 +39,3 @@ func ExamplePrompt() {
39
39
// The result of the prompt, if valid, is displayed in a formatted message.
40
40
fmt .Printf ("You answered %s\n " , result )
41
41
}
42
-
Original file line number Diff line number Diff line change @@ -72,4 +72,4 @@ func ExampleSelect() {
72
72
73
73
// The selected pepper will be displayed with its name and index in a formatted message.
74
74
fmt .Printf ("You choose number %d: %s\n " , i + 1 , peppers [i ].Name )
75
- }
75
+ }
Original file line number Diff line number Diff line change @@ -99,26 +99,26 @@ type Select struct {
99
99
// and trigger search mode. See the Key struct docs for more information on keys.
100
100
type SelectKeys struct {
101
101
// Next is the key used to move to the next element inside the list. Defaults to down arrow key.
102
- Next Key
102
+ Next Key
103
103
104
104
// Prev is the key used to move to the previous element inside the list. Defaults to up arrow key.
105
- Prev Key
105
+ Prev Key
106
106
107
107
// PageUp is the key used to jump back to the first element inside the list. Defaults to left arrow key.
108
- PageUp Key
108
+ PageUp Key
109
109
110
110
// PageUp is the key used to jump forward to the last element inside the list. Defaults to right arrow key.
111
111
PageDown Key
112
112
113
113
// Search is the key used to trigger the search mode for the list. Default to the "/" key.
114
- Search Key
114
+ Search Key
115
115
}
116
116
117
117
// Key defines a keyboard code and a display representation for the help menu.
118
118
type Key struct {
119
119
// Code is a rune that will be used to compare against typed keys with readline.
120
120
// Check https://github.com/chzyer/readline for a list of codes
121
- Code rune
121
+ Code rune
122
122
123
123
// Display is the string that will be displayed inside the help menu to help inform the user
124
124
// of which key to use on his keyboard for various functions.
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ var (
10
10
IconInitial = Styler (FGBlue )("?" )
11
11
12
12
// IconGood is the icon used when a good answer is entered in prompt mode.
13
- IconGood = Styler (FGGreen )("✔" )
13
+ IconGood = Styler (FGGreen )("✔" )
14
14
15
15
// IconWarn is the icon used when a good, but potentially invalid answer is entered in prompt mode.
16
- IconWarn = Styler (FGYellow )("⚠" )
16
+ IconWarn = Styler (FGYellow )("⚠" )
17
17
18
18
// IconBad is the icon used when a bad answer is entered in prompt mode.
19
- IconBad = Styler (FGRed )("✗" )
19
+ IconBad = Styler (FGRed )("✗" )
20
20
21
21
// IconSelect is the icon used to identify the currently selected item in select mode.
22
- IconSelect = Styler (FGBold )("▸" )
22
+ IconSelect = Styler (FGBold )("▸" )
23
23
)
Original file line number Diff line number Diff line change 8
8
IconInitial = Styler (FGBlue )("?" )
9
9
10
10
// IconGood is the icon used when a good answer is entered in prompt mode.
11
- IconGood = Styler (FGGreen )("v" )
11
+ IconGood = Styler (FGGreen )("v" )
12
12
13
13
// IconWarn is the icon used when a good, but potentially invalid answer is entered in prompt mode.
14
- IconWarn = Styler (FGYellow )("!" )
14
+ IconWarn = Styler (FGYellow )("!" )
15
15
16
16
// IconBad is the icon used when a bad answer is entered in prompt mode.
17
- IconBad = Styler (FGRed )("x" )
17
+ IconBad = Styler (FGRed )("x" )
18
18
19
19
// IconBad is the icon used to identify the currently selected item in select mode.
20
- IconSelect = Styler (FGBold )(">" )
20
+ IconSelect = Styler (FGBold )(">" )
21
21
)
You can’t perform that action at this time.
0 commit comments