ipinfo/cli

[feature] Allow comments in text files and inputs

Closed this issue · 0 comments

eacp commented

Lets say I have a file with some IP addresses, lets call it ips.txt

# Cloudflare IPs
1.1.1.1
1.1.1.3

# Netflix IPs

2600:1f18:631e:2f84:4f7a:4092:e2e9:c617
2600:1f18:631e:2f85:93a9:f7b0:d18:89a7


# Some email servers
67.231.149.43

Right now, if I execute ipinfo bulk ips.txt I only get

{
  "1.1.1.1": {
    "ip": "1.1.1.1",
    "hostname": "one.one.one.one",
    "anycast": true,
    "city": "Miami",
    "region": "Florida",
    "country": "US",
    "country_name": "United States",
    "loc": "25.7867,-80.1800",
    "org": "AS13335 Cloudflare, Inc.",
    "postal": "33132",
    "timezone": "America/New_York"
  },
  "1.1.1.3": {
    "ip": "1.1.1.3",
    "anycast": true,
    "city": "Miami",
    "region": "Florida",
    "country": "US",
    "country_name": "United States",
    "loc": "25.7867,-80.1800",
    "org": "AS13335 Cloudflare, Inc.",
    "postal": "33132",
    "timezone": "America/New_York"
  }
}

IDK why it stops at the SECOND comment tho.

It would be interesting to allow files (and inputs from stdin or a pipe) to have comments. It could be ANY syntax for comments,
but the # sign is already familiar to multiple developers. Granted, you COULD pipe it thru a process that REMOVES comment
lines first (like GREP for example), but it would still be interesting to do it in the command directly.