Created
January 29, 2020 11:02
-
-
Save Gufran/dd9aa31fcd09069a6603917d1b2f7820 to your computer and use it in GitHub Desktop.
Add nice looking help text to bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function help { # Print help text | |
echo "Available commands:" | |
grep '^function' "${BASH_SOURCE[0]}" | sed -e 's/function / /' -e 's/{ //' | column -t -s\# | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment