zu1k / nali

An offline tool for querying IP geographic information and CDN provider. 一个查询IP地理信息和CDN服务提供商的离线终端工具.
https://github.com/zu1k/nali
MIT License
3.74k stars 340 forks source link

查询结果没有固定结构 #174

Closed lovelyjuice closed 11 months ago

lovelyjuice commented 11 months ago

比如我想通过grep等方式从一个IP列表中筛选出中国的IP,但是存在以下数据,只能用人来判断IP是否属于国内,grep是做不到的

[中国 移动]
[中国 电信/骨干网]
[韩国]
[日本 东京]
[韩国首尔特别市 Microsoft]
[浙江省 阿里云BGP节点]
[北京市 联通]
[广东省广州市 腾讯云]
[广西 移动/数据上网公共出口]
[美国加利福尼亚州硅谷 腾讯云]
[美国 Peer1网络公司]
[新加坡 腾讯云]
zu1k commented 11 months ago

try json format mode.

# nali -j 1.2.3.4
{"type":0,"ip":"1.2.3.4","text":"澳大利亚 APNIC Debogon-prefix网络","source":"qqwry","info":{"country":"澳大利亚","area":"APNIC Debogon-prefix网络"}}

Please note that the result is directly related to the ip database, you can try other databases.

lovelyjuice commented 11 months ago

为什么我没有这个参数,版本是 0.7.3

PS D:\Tools\nali> .\nali-windows-amd64.exe -j 1.2.3.4
Error: unknown shorthand flag: 'j' in -j
Usage:
  nali [flags]
  nali [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  info        get the necessary information of nali
  update      update qqwry, zxipv6wry, ip2region ip database and cdn

Flags:
      --gbk       Use GBK decoder
  -h, --help      help for nali
  -v, --version   version for nali

Use "nali [command] --help" for more information about a command.

2023/09/26 10:20:47 unknown shorthand flag: 'j' in -j
PS D:\Tools\nali> .\nali-windows-amd64.exe -v
nali version v0.7.3
zu1k commented 11 months ago

Sorry for that, this will be released on 0.8.0

zu1k commented 11 months ago

try 0.8.0