Guess user location when running `weather ""`

Omitting colon makes bash substitute default location only when parameter is absent.
Therefore empty city name propagates to wttr.in and allows it to guess.
pull/250/head
Alexander Meshcheryakov 6 years ago committed by GitHub
parent d3b28cbf09
commit dce65ed181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,7 @@
wttr()
{
# change Paris to your default location
local request="wttr.in/${1:-Paris}"
local request="wttr.in/${1-Paris}"
[ "$COLUMNS" -lt 125 ] && request+='?n'
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
}

Loading…
Cancel
Save