Skip to content

Commit 66070dc

Browse files
N3WK1Dtwpayne
N3WK1D
authored andcommittedSep 26, 2023
docs: Added an example for promptChoice
1 parent 5f14f10 commit 66070dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
# `promptChoice` *prompt* *choices* [*default*]
22

33
`promptChoice` prompts the user with *prompt* and *choices* and returns the user's response. *choices* must be a list of strings. If *default* is passed and the user's response is empty then it returns *default*.
4+
5+
!!! example
6+
7+
```
8+
{{- $choices := list "desktop" "server" -}}
9+
{{- $hosttype := promptChoice "What type of host are you on" $choices -}}
10+
[data]
11+
hosttype = {{- $hosttype | quote -}}
12+
```

0 commit comments

Comments
 (0)
Please sign in to comment.