Created
December 13, 2022 05:36
-
-
Save mattdanielbrown/af091a529b61980c9701f4d005698e5b to your computer and use it in GitHub Desktop.
Bash Script USAGE (function, message, text content) TEMPLATE ( and/or example ... )
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
| # Print usage | |
| usage() { | |
| echo -n "${scriptName} [OPTION]... [FILE]... | |
| NAME | |
| ============================================================================== | |
| The Full Name | |
| • Expanded or 'Friendly' : Name Of The Script/App/Project | |
| • SOURCE FILE : 'true_executable_filename' | 'source_script_filename.sh' | |
| • EXEC|CMD|ALIAS Name(s) : 'exec_name' , 'cmdAlias' , 'cliToolName' | |
| DESCRIPTION | |
| ============================================================================== | |
| This is my script template. | |
| OPTIONS | |
| ============================================================================== | |
| -f, --foo Foo param, arg or flag opt | |
| -b, --bar Bar param, arg or flag opt | |
| -a, --automate Skip all user interaction, assuming default vaules | |
| -q, --quiet Quiet (no output) | |
| -l, --log Print log to file | |
| -s, --strict Exit script with null variables. i.e 'set -o nounset' | |
| -V, --verbose Output more information. (Items echoed to 'verbose') | |
| -d, --debug Runs script in BASH debug mode (set -x) | |
| -h, --help Display this help and exit | |
| -v --version Output version information and exit | |
| " | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment