Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. if [[ ${*} =~ help|-h || ${#} == 0 ]]; then cat <<HELP_USAGE | sed "s/^#? //"
  4. #? USAGE
  5. #? ======
  6. #? Anywhere in your script:
  7. #?
  8. #? if [[ $* =~ help|-h || $# == 0 ]]; then cat <<HELP_USAGE | sed "s/^#? //"
  9. #? #? Documentation lines prefixed with '#? '
  10. #? HELP_USAGE
  11. #? exit 0; fi
  12. #?
  13. #? FEATURES
  14. #? ========
  15. #? * Preformatted.
  16. #? * Variable expansion: \${HOME} is '${HOME}'
  17. #? * Commands can be executed
  18. #? '\$(echo Foo)' results in '$(echo Foo)'
  19. #? * Script being documented can self referenced
  20. #? '\${0}' => '${0}'
  21. #?
  22. HELP_USAGE
  23. exit 0; fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement