We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a52e5c commit 5f14f10Copy full SHA for 5f14f10
assets/chezmoi.io/docs/reference/templates/init-functions/promptChoiceOnce.md
@@ -3,3 +3,12 @@
3
`promptChoiceOnce` returns the value of *map* at *path* if it exists and is a
4
string, otherwise it prompts the user for one of *choices* with *prompt* and an
5
optional *default* using `promptChoice`.
6
+
7
+!!! example
8
9
+ ```
10
+ {{- $choices := list "desktop" "laptop" "server" "termux" -}}
11
+ {{- $hosttype := promptChoiceOnce . "hosttype" "What type of host are you on" $choices -}}
12
+ [data]
13
+ hosttype = {{- $hosttype | quote -}}
14
0 commit comments