davidovich / summon

Summon: your data on caffeine
Apache License 2.0
12 stars 0 forks source link

feature: add a "question" template for getting input from user in templates #84

Open davidovich opened 2 years ago

davidovich commented 2 years ago

I see it practical that we provide a "question" template function that could be used to ask user about inputting info

Used in a summon file something like:

namespace: {{ question "what namespace should be used" "default" }}
cluster: {{ question "please specify the destination cluster" [splice of choices] }}
davidovich commented 1 month ago

Questions or input can be pre-defined or inlined. Inlining is order dependant, naturally. Pre-defined inputs are invoked at program startup time. One would prefer to design the cli with the former as it would be less surprising than in-the-middle execution stops for prompting. Inlining would be used in conditional scenarios where an input is only needed for a certain part of the cli hierarchy, or optional data.