Conditional adding/removing of choices #704
Unanswered
MaciejPatro
asked this question in
Q&A
Replies: 2 comments 2 replies
-
There's really not a much better option available right now 🤔 This is the 1st time I see this use case. I guess #698 will help you here, being able to validate an answer and provide feedback on why it cannot be chosen. Also we could add support for the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Maybe we could remove empty choices from the list? unit_testing:
type: str
default: null
choices:
- "{% if cpp_standard > 0 %}doctest{% endif %}"
- GTest
- None Just like we don't create files/dirs with empty names? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
What is the intended way to handle adding/removing choices based on previously answered prompt?
The example is I want to let user have more options of unit testing frameworks based on C++ standard the project is supposed to support:
I've solved this problem in this way:
and using context hook I populate
unit_testing
with the correct choice.Is there a smarter way of handling "conditional" choices? Because if I would like to introduce support for C++17 or newer unit testing framework I would need to again add another parameter and complicate the
copier.yaml
file even more.Beta Was this translation helpful? Give feedback.
All reactions