Below is an install script, which shows help using sed.
#!/usr/bin/env bash
# Usage: [sudo] [prefix=/usr/local] ./install
set -e
case "$1" in
'-h' | '--help' )
sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' < "$0"
exit 0
;;
esac
Refactor all executables that show simple help messages.