Skip to content

Instantly share code, notes, and snippets.

@aduzsardi
Forked from kovetskiy/samizdat-shell-help.bash
Created November 13, 2020 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aduzsardi/cf9fe356d569bd35cc53a2a3e9cb9ff2 to your computer and use it in GitHub Desktop.
Save aduzsardi/cf9fe356d569bd35cc53a2a3e9cb9ff2 to your computer and use it in GitHub Desktop.
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
### -h Show this message.
help() {
sed -rn 's/^### ?//;T;p' "$0"
}
if [[ $# == 0 ]] || [[ "$1" == "-h" ]]; then
help
exit 1
fi
echo Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment