fixed the glitch with two plus word city/country names, should work now

This commit is contained in:
inxi-svn 2013-05-18 05:28:30 +00:00
parent 7b312d6a42
commit a8c397a3cb
2 changed files with 3 additions and 4 deletions

6
inxi
View file

@ -2556,8 +2556,7 @@ show_options()
if [[ $B_ALLOW_WEATHER == 'true' ]];then
print_screen_output "-! location=<location> - <location> Supported types: zip (postal) code; city,state; latitude,longtitude"
print_screen_output " Only use if you want the weather somewhere other than the machine running $SCRIPT_NAME."
print_screen_output " Must be used with -w. Note: cities/countries with two words in name don't work right,"
print_screen_output " use zipcode or latitude,longitude instead."
print_screen_output " Must be used with -w."
fi
if [[ $1 == 'full' ]];then
print_screen_output " "
@ -7981,7 +7980,8 @@ get_weather_data()
# first we get the location data, once that is parsed and handled, we move to getting the
# actual weather data, assuming no errors
if [[ -n $ALTERNATE_WEATHER_LOCATION ]];then
location=$ALTERNATE_WEATHER_LOCATION
# note, this api does not support spaces in names
location=$( sed 's/[[:space:]]*//g' $ALTERNATE_WEATHER_LOCATION )
else
if [[ $b_test_loc != 'true' ]];then
location_data=$( wget -q -t 1 -T $WGET_TIMEOUT -O- $location_site || wget_error=$? )

1
inxi.1
View file

@ -386,7 +386,6 @@ Turns on hostname in System line. Overrides inxi config file value (if set): B_S
.TP
.B \-! location=<location_string>
With \-w, get weather for an alternate location. Accepts postal/zip code, city,state pair, or latitude,longitude.
Note: cities/countries with two words in name don't work right, use zipcode or latitude,longitude instead.
Examples: \-! location=95623 OR \-! location=Boston,MA OR \-! location=45.5234,\-122.6762
.SH DEBUGGING OPTIONS