massimocandela / geofeed-finder

Utility to find geofeed files linked from rpsl.
BSD 3-Clause "New" or "Revised" License
76 stars 7 forks source link

Clarify -u and -r in documentation #31

Closed sid6mathur closed 9 months ago

sid6mathur commented 9 months ago

As a tool user, I would like the output CSV to contain invalid ISO codes (RFC 8805) as I wish to post-process them. It's not clear from the README how -u and -r differ. Can the explanation be improved?

-k | Keep entries with invalid ISO codes. Not recommended.
-u | Keep invalid subdivisions (accept invalid ISO regions/subdivisions, but keep validating the rest). Not recommended.
-r | Remove invalid subdivisions but keep the rest of the geofeed if valid.

Does -u=true imply -r=false , for example?

massimocandela commented 9 months ago

with -k:

1.2.3.4,UK,UK-ENG,  >  1.2.3.4,UK,UK-ENG,
1.2.3.4,GB,UK-ENG,  >  1.2.3.4,GB,UK-ENG,

with -u:

1.2.3.4,UK,UK-ENG,  >  null
1.2.3.4,GB,UK-ENG,  >  1.2.3.4,GB,UK-ENG,

with -r:

1.2.3.4,UK,UK-ENG,  >  null
1.2.3.4,GB,UK-ENG,  >  1.2.3.4,GB,,
sid6mathur commented 9 months ago

Thank you! It would be great to add the above example behaviour to the README.

sid6mathur commented 9 months ago

As of v1.21.1, entries with 3-letter country codes get suppressed from the output CSV despite the '-k' flag. Can we please let them through?

Examples from the error log:

2024-01-10T07:54:30+00:00 45.120.137.0/24,USA,US-NC,Asheville, Not valid Country Code (iso-3166-1)
2024-01-10T07:54:30+00:00 45.120.138.0/24,USA,US-NC,Asheville, Not valid Country Code (iso-3166-1)
2024-01-10T07:54:30+00:00 2001:0df2:1001:0000:0000:0000:0000:0000/48,USA,US-NC,Asheville, Not valid Country Code (iso-3166-1)
massimocandela commented 9 months ago

The logs shows the error no matter what, but it doesn't mean that they are discarded. The specific prefixes are discarded because not linked by any encompassing inetnum for what I can see.

sid6mathur commented 9 months ago

The logs shows the error no matter what, but it doesn't mean that they are discarded. The specific prefixes are discarded because not linked by any encompassing inetnum for what I can see.

Sounds good in that case, thanks for checking :)