| # https://www.redhat.com/sysadmin/arguments-options-bash-scripts | # https://www.redhat.com/sysadmin/arguments-options-bash-scripts | ||||
| ############################################################ | ############################################################ | ||||
| # Subprograms # | |||||
| # subprograms # | |||||
| ############################################################ | ############################################################ | ||||
| License() | License() | ||||
| { | { | ||||
| } | } | ||||
| ############################################################ | ############################################################ | ||||
| ############################################################ | ############################################################ | ||||
| # Main program # | |||||
| # main program # | |||||
| ############################################################ | ############################################################ | ||||
| ############################################################ | ############################################################ | ||||
| # Set variables | |||||
| # set variables | |||||
| directory="/Users/ad7588/projects/patent_site_python" | directory="/Users/ad7588/projects/patent_site_python" | ||||
| # Get the options | |||||
| # error message for no flags | |||||
| if (( $# == 0 )); then | |||||
| Help | |||||
| exit 1 | |||||
| fi | |||||
| # get the options | |||||
| while getopts ":hlimzaespxdw" option; do | while getopts ":hlimzaespxdw" option; do | ||||
| case $option in | case $option in | ||||
| l) # display License | l) # display License | ||||
| Import | Import | ||||
| exit;; | exit;; | ||||
| \?) # Invalid option | \?) # Invalid option | ||||
| echo "Error: Invalid option" | |||||
| Help | |||||
| exit;; | exit;; | ||||
| esac | esac | ||||
| done | done |