From c7cb67f84197de6e3c5dcf44306ef807728b48b9 Mon Sep 17 00:00:00 2001 From: Jason Dusek Date: Sun, 15 May 2022 11:30:56 -0500 Subject: [PATCH] Ensure `M` enables metric It seems reasonable, per the documentation (under the section, "Weather Units"), that `?M` would enable metric ("metric (SI), but show wind speed in m/s") all by itself. > By default the USCS units are used for the queries from the USA and the metric system for the rest of the world. You can override this behavior... > ... > `curl wttr.in/Amsterdam?M` # metric (SI), but show wind speed in m/s In the USA, we have to pass `?m&M` (`https://wttr.in/?m&M`) to get metric and meters/second. If we just pass `?M`, we get USCS units for everything else and windspeed in meters/second. --- lib/parse_query.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/parse_query.py b/lib/parse_query.py index 6c45e56..e598a2b 100644 --- a/lib/parse_query.py +++ b/lib/parse_query.py @@ -84,6 +84,7 @@ def parse_query(args): if 'm' in q: result['use_metric'] = True if 'M' in q: + result['use_metric'] = True result['use_ms_for_wind'] = True if 'u' in q: result['use_imperial'] = True