New project: bash boilerplate generator on toolstud.io03 Jun 2018
I like to automate. I like it so much that I will not hesitate to spend 8+ hours on writing a script that replaces 5 minutes of work every month. Most of my automation is for CLI (command line interfaces). On Windows, that means CMD, but for most other platforms (Linux, MacOS, Busybox) the best tool for it is bash or shell. I’ve created my own self-contained bash boilerplate script (a good scripting starting point, with a lot of regularly recurring functionality already built in.)
But I still needed to
git clone the repository, or copy/paste from the github page, and customise it every time (using different options, parameters). So I went 1 step further: here is now the fully interactive, always up-to-date BASH BOILERPLATE GENERATOR
With just one click, you can get the boilerplate code for CLI scripts like:
convert_a_file.sh [action] [outputfile] [inputfile(s)]
send_an_email.sh --from [from] [destination] [subject] [body]
compress_files.sh --test --method [method} [zipfile] [file(s)]
The boilerplate code takes care of
- option parsing: use flags (e.g.
-vfor verbose), options (e.g.
--steps 20) with short and long name (e.g.
- different output commands for verbose/normal/error messages
- confirmation yes/no …
The only things you still need to add is the actual code that does all that stuff that you wanted to automate.