Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
Added displaying help information when file is not entered.
Browse files Browse the repository at this point in the history
  • Loading branch information
almostengr committed Jul 21, 2017
1 parent e700d48 commit 14e5eaf
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions get_weather.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@

# log all of the status and error messages
function log_message() {
echo $(date)" | "$*
# echo $(date)" | "$*
echo $*
}

function show_help() {
# Show the help documentation
log_message ""
log_message "Usage:"
log_message "get_weather.sh <param>"
log_message ""
log_message "Param can be replaced with one of the following:"
log_message "configfile - The full path of the configuration file."
log_message "help - Show the help information about this script."
log_message ""
log_message "For more information, visit https://github.com/bitsecondal/farmosnws"
}

## SCRIPT MAIN ## SCRIPT MAIN ## SCRIPT MAIN ##
## SCRIPT MAIN ## SCRIPT MAIN ## SCRIPT MAIN ##
Expand All @@ -37,6 +51,7 @@ if [[ -f ${FILENAME} ]]; then

log_message "Done getting the weather data"
else
log_message "Configuration file does not exist."
log_message "Configuration file does not exist."
show_help
fi

0 comments on commit 14e5eaf

Please sign in to comment.