jacobdeichert / mask

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

Add --maskfile-introspect flag to print out the maskfile command structure as json #85

Closed jacobdeichert closed 3 years ago

jacobdeichert commented 3 years ago

I've heard from a few different users that they want the ability to generate autocomplete commands for mask. Up until now, I've been suggesting that parsing the maskfile for command headings was a good enough solution. However, parsing out named flags and arguments becomes much more difficult.

Today I published mask-parser which contains all of the parsing logic mask uses for the maskfile.md format.

This PR adds a flag to mask --maskfile-introspect which prints out the entire maskfile command structure as json which can be consumed by other programs/libs at runtime. This should be helpful for tools that need to generate autocomplete commands.