diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2022-07-08 13:37:09 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2022-07-08 13:37:09 -0400 |
| commit | f386f15847646d8140d9a1d4c50e9f07d5371d2c (patch) | |
| tree | ff27371755da508aa606c56f611302858820758e | |
| parent | 5c86bab04fd4074810210c3dc3579eded2fc223c (diff) | |
Check for *all* tags instead of *any* tags
| -rwxr-xr-x | nowopen | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -114,16 +114,23 @@ local function get_weekday(str) end end +local function matches_tags(place, tags) + for _,request_tag in ipairs(tags) do + for _,tag in ipairs(place.tags) do + if tag:sub(1,#request_tag) == request_tag then goto next_tag end + end + if true then return false end + ::next_tag:: + end + return true +end + local options = {} for i,place in ipairs(places) do if arg[1] then - for _,request_tag in ipairs(arg) do - for _,tag in ipairs(place.tags) do - if tag:sub(1,#request_tag) == request_tag then goto carry_on end - end + if not matches_tags(place, arg) then + goto next_place end - goto next_place - ::carry_on:: end local today_times = nil for _,time in ipairs(place.times) do |
