mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 09:52:13 +02:00
dce65ed181
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.
8 lines
204 B
Plaintext
8 lines
204 B
Plaintext
wttr()
|
|
{
|
|
# change Paris to your default location
|
|
local request="wttr.in/${1-Paris}"
|
|
[ "$COLUMNS" -lt 125 ] && request+='?n'
|
|
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
|
|
}
|