ansiweather

Weather in terminal, with ANSI colors and Unicode symbols
Log | Files | Refs | README | LICENSE

commit 4fd51763bcf4627479fc177163b2f653dcb4d418
parent 892d3567907cb79af38bb0434bf9298ad620b119
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sun, 16 Aug 2015 22:13:45 +0200

Adding a '-v' option to display usage

Diffstat:
Mansiweather | 24+++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/ansiweather b/ansiweather @@ -102,7 +102,7 @@ dateformat=$(get_config "dateformat" || echo "%a %b %d") timeformat=$(get_config "timeformat" || echo "%b %d %r") # Or get config options from command line flags -while getopts l:u:s:f:Fd: option +while getopts l:u:s:f:Fd:v option do case "${option}" in @@ -112,11 +112,33 @@ do f) forecast=${OPTARG};; F) forecast="5";; d) daylight=${OPTARG};; + v) usage=true;; esac done +#### [ Display usage ]######################################################### + +if [ "$usage" = true ] +then + echo "\nAnsiWeather 1.02 (c) by Frederic Cambus 2013-2015\n" \ + "\nUSAGE: ansiweather [options]\n" \ + "\nOptions are :\n\n" \ + " -l Specify location\n" \ + " -u Specify unit system to use (metric or imperial)\n" \ + " -s Toggle symbol display\n" \ + " -f Toggle forecast mode for the specified number of upcoming days\n" \ + " -F Toggle forecast mode for the next five days\n" \ + " -d Toggle daylight data display\n" \ + " -v Display usage\n" + + echo "EXAMPLES: ansiweather -l Moscow,RU -u metric -s true -f 5 -d true\n" + exit +fi + + + #### [ Colors and characters ]################################################# background=$(get_config "background" || echo "\033[44m")