4 ms·
One thing I like about make is that you get an automated bash completion for targets, which I find helpful. Is there an equivalent sneakiness for doing this wit
by anitil 5y ago
One thing I like about make is that you get an automated bash completion for targets, which I find helpful. Is there an equivalent sneakiness for doing this with this style of script?
- nickjj 5y agoI have not found a way to do that, but other Bash driven CLI tools do offer completion. It might come down to having to define a separate completion file. Something like this: https://askubuntu.com/questions/68175/how-to-create-script-with-auto-complete https://askubuntu.com/questions/68175/how-to-create-script-w... If you check the first link in my previous reply it does include an auto-generated help menu that uses compgen to print a list of functions near the bottom. This way you can run `./run` or `./run help` to get a list of commands. I find this is helpful enough without needing completion, especially since every function ends up being a top level command.
- anitil 5y agoAh yes I did see the compgen bit, and promptly stole it for all my scripts