Merge pull request #250 from Self-Perfection/patch-1
Handle narrow terminals in sample bash function
This commit is contained in:
commit
004da5fd3f
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
wttr()
|
wttr()
|
||||||
{
|
{
|
||||||
# change Paris to your default location
|
# change Paris to your default location
|
||||||
curl -H "Accept-Language: ${LANG%_*}" wttr.in/"${1:-Paris}"
|
local request="wttr.in/${1-Paris}"
|
||||||
|
[ "$COLUMNS" -lt 125 ] && request+='?n'
|
||||||
|
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue