Add windspeed units option weather (#111)

This commit is contained in:
Albin N 2017-08-01 14:58:44 +02:00 committed by Alex Epstein
parent 4bfb2f6881
commit 72bbdf4f90
1 changed files with 21 additions and 0 deletions

View File

@ -151,8 +151,29 @@ elif [[ $1 == "update" ]]; then
update
elif [[ $1 == "m" ]]; then
getIPWeather "?m"
elif [[ "${@: -1}" == "m" ]];then
args=$( echo "${@:1:(($# - 1))}" ?m | sed s/" "//g)
getLocationWeather $args
elif [[ $1 == "M" ]]; then
getIPWeather "?M"
elif [[ "${@: -1}" == "M" ]];then
args=$( echo "${@:1:(($# - 1))}" ?M | sed s/" "//g)
getLocationWeather $args
elif [[ $1 == "mM" || $1 == "Mm" ]]; then
getIPWeather "?m?M"
elif [[ "${@: -1}" == "mM" || "${@:-1}" == "Mm" ]];then
args=$( echo "${@:1:(($# - 1))}" ?m?M | sed s/" "//g)
getLocationWeather $args
elif [[ $1 == "iM" || $1 == "Mi" ]]; then
getIPWeather "?u?M"
elif [[ "${@: -1}" == "iM" || "${@:-1}" == "Mi" ]];then
args=$( echo "${@:1:(($# - 1))}" ?u?M | sed s/" "//g)
getLocationWeather $args
elif [[ $1 == "i" ]]; then
getIPWeather "?u"
elif [[ "${@: -1}" == "i" ]];then
args=$( echo "${@:1:(($# - 1))}" ?u | sed s/" "//g)
getLocationWeather $args
else
getLocationWeather "$@"
fi