After grappling with the frustrations of manually styling long bash commands for over a decade, I finally created a tool to automate it. The motivation was simple: most DevOps professionals, like myself, document their commands. When tutorials or services (take Google Cloud Platform for instance) provide long commands on a single line, it's a legibility nightmare.
This might seem trivial for one-off commands, but it quickly becomes a tedious chore with frequent DevOps tasks.
In light of this, I introduce to you, the *Bash Command Prettifier*.
All you have to do is input your lengthy bash command, and the script will automatically format it with a neat line-break after every parameter, making it easily readable and perfect for documentation.
1 comment
[ 5.2 ms ] story [ 174 ms ] threadAfter grappling with the frustrations of manually styling long bash commands for over a decade, I finally created a tool to automate it. The motivation was simple: most DevOps professionals, like myself, document their commands. When tutorials or services (take Google Cloud Platform for instance) provide long commands on a single line, it's a legibility nightmare.
Example from GCP:
After spending far too much time manually adding line breaks and styling, it would look like: This might seem trivial for one-off commands, but it quickly becomes a tedious chore with frequent DevOps tasks.In light of this, I introduce to you, the *Bash Command Prettifier*.
All you have to do is input your lengthy bash command, and the script will automatically format it with a neat line-break after every parameter, making it easily readable and perfect for documentation.
The code is available as an open-source gist here: Bash Command Prettifier (https://gist.github.com/lucgagan/9f4219058f89c9d003ceced6d1d...)
Would love feedback, improvements, or any thoughts. If this has been a pain point for you too, hope this helps ease your DevOps documentation woes!
Test it online: https://ray.run/tools/bash-command-formatter