kyleburton / bake

Pure bash, very lightweight scripting and build framework.
29 stars 8 forks source link

Completions #32

Open ischaaf opened 5 years ago

ischaaf commented 5 years ago

Spent some time messing around with completions, curious to get your thoughts. Note: I don't feel this is actually ready for merging yet, just looking to get some eyes on it

The basic approach is to add a file alongside Bakefile that will store the completion functions. When completion is called it will source that file then check if a function exists matching the naming convention

_bake_completion_TASK_NAME

If so, that function will be used to provide completions (via white-space delimited stdout)

As I'm writing this, I'm realizing I could just move all completion responsibility to that function and have it simply provide completions via COMPREPLY

If no function is found then we fallback on default completion.

Key drawbacks that I see: