cli
cli copied to clipboard
fix csv format
fixed #85
Address is the only field that'll break csv froamt, so we can explicitly quote address field to counter this issue
Is this WIP or actually ready @rm-Umar ?
As I expected the CSV writer adds a newline at the end on each write it does, so we have all kinds of weird scenarios happening:
$ ./build/ipinfo bulk --csv -f asn 1.1.1.1 2.2.2.2
ip,asn_id,asn_name,asn_domain,asn_route,asn_type
1.1.1.1,AS13335,"Cloudflare, Inc.",cloudflare.com,1.1.1.0/24,hosting
2.2.2.2,AS3215,Orange S.A.,orange.com,2.2.0.0/16,isp
$ ./build/ipinfo bulk --csv -f asn,asn 1.1.1.1 2.2.2.2
ip,asn_id,asn_name,asn_domain,asn_route,asn_type,asn_id,asn_name,asn_domain,asn_route,asn_type
1.1.1.1,AS13335,"Cloudflare, Inc.",cloudflare.com,1.1.1.0/24,hosting
,AS13335,"Cloudflare, Inc.",cloudflare.com,1.1.1.0/24,hosting
2.2.2.2,AS3215,Orange S.A.,orange.com,2.2.0.0/16,isp
,AS3215,Orange S.A.,orange.com,2.2.0.0/16,isp
Is this WIP or actually ready @rm-Umar ?
It's still in progress I'll mark it ready when it's ready.
Ah okay. Got pinged for review so wasn't sure :smile:
Ah okay. Got pinged for review so wasn't sure smile
Now it's ready to review.
Will release it tomorrow or the day after hopefully.