Skip to content

Instantly share code, notes, and snippets.

@Gufran
Created January 29, 2020 11:02
Show Gist options
  • Save Gufran/dd9aa31fcd09069a6603917d1b2f7820 to your computer and use it in GitHub Desktop.
Save Gufran/dd9aa31fcd09069a6603917d1b2f7820 to your computer and use it in GitHub Desktop.
Add nice looking help text to bash script
#!/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