Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- if [[ ${*} =~ help|-h || ${#} == 0 ]]; then cat <<HELP_USAGE | sed "s/^#? //"
- #? USAGE
- #? ======
- #? Anywhere in your script:
- #?
- #? if [[ $* =~ help|-h || $# == 0 ]]; then cat <<HELP_USAGE | sed "s/^#? //"
- #? #? Documentation lines prefixed with '#? '
- #? HELP_USAGE
- #? exit 0; fi
- #?
- #? FEATURES
- #? ========
- #? * Preformatted.
- #? * Variable expansion: \${HOME} is '${HOME}'
- #? * Commands can be executed
- #? '\$(echo Foo)' results in '$(echo Foo)'
- #? * Script being documented can self referenced
- #? '\${0}' => '${0}'
- #?
- HELP_USAGE
- exit 0; fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement