jacobdeichert / mask

🎭 A CLI task runner defined by a simple markdown file
MIT License
1.11k stars 55 forks source link

Add choices list #111

Closed lovejia2022 closed 4 months ago

lovejia2022 commented 5 months ago

If we add a "choices" list to a mask task flag, and if flag value is not one of the choices, this task will fail.

Which issue does this fix?

This is discussed in issue #91.

I don't add filepath and dirpath in this PR, I think this might need more discussion.

Describe the solution

Before pass arguments to scripts, I check if this flag value shows in the choices list.

jacobdeichert commented 5 months ago

Thanks for the PR! I plan on finding time this week to review 👍

lovejia2022 commented 5 months ago

I find out that we do not really need a enum type, choices is enough. :thinking: