I've built a tool called sol (like "soul") that helps you inspect and format complex shell one-liners. Features:
- Choose which transformations you want (break on pipe, args, redirect, whatever)
- "Peeks" into stringified commands (think xargs, parallel) and formats those, too
- Auto-breaks at a given width (e.g., 80 characters)
- Shows you non-standard aliases, functions, files, etc. that you might not have in your shell environment
- Breaks up long jq lines with jqfmt because—let's be honest—they're getting out of hand
As a security researcher and tool developer, I often encounter (or create) long pipelined Bash commands. While quick and powerful, they can be a nightmare to read or debug. I created sol to make it easier to understand and share these commands with others.
Feature request, which I would love to have in all my automation scripts:
Replace short flags with the long switches. Short flags are great when typing in a terminal but I don't want to figure out 2 years from now what the
does, and I have to assume that it's NOT --version --file --dry-run, but --verbose, --force, and --dont-ask-before-deleting-everythingI try to use long options in my script, therefore (especially in a team, where not everyone is familiar with every single command)