commit 30e7f06057b0932023aa7a5f9097d2e1641e6968 parent eb25a3b508fbf6dc4044d7bf6641ee4885559f8f Author: Frederic Cambus <fcambus@users.sourceforge.net> Date: Thu, 24 Oct 2013 15:44:09 +0200 When given, take units from the second command-line argument Diffstat:
M | ansiweather | | | 15 | +++++++++++---- |
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/ansiweather b/ansiweather @@ -35,13 +35,20 @@ function get_config { } # Location : example "Moscow,RU" -location=$(get_config "location" || echo "Moscow,RU") -if [ ! -z "$1" ]; then - location=$1; +if [ ! -z "$1" ] +then + location=$1; +else + location=$(get_config "location" || echo "Moscow,RU") fi # System of Units : "metric" or "imperial" -units=$(get_config "units" || echo "metric") +if [ ! -z "$2" ] +then + units=$2 +else + units=$(get_config "units" || echo "metric") +fi # Display symbols : "true" or "false" (requires an Unicode capable display) symbols=$(get_config "symbols" || echo true)